Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use generated PSI in plugin #378

Open
knisht opened this issue Jul 12, 2022 · 3 comments
Open

Don't use generated PSI in plugin #378

knisht opened this issue Jul 12, 2022 · 3 comments

Comments

@knisht
Copy link
Collaborator

knisht commented Jul 12, 2022

Arend's PSI tree is in fact a CST, not an AST. It results in a lot off difficulties with this tree: there are some strange nodes like ArendAtomFieldAcc, and the tree is highly unstable -- any changes in grammar result in a ton of changes in PSI clients.

Grammar Kit allows to delegate the creation of PSI tree to the author of a plugin. It should help us to create user-controlled PSI structure, that inherits Abstract nodes directly, which should simplify the overall interaction with AST in plugin.

Unfortunately, it requires to make changes almost everywhere in the plugin.

@ice1000
Copy link
Collaborator

ice1000 commented Jul 13, 2022

I wanted to do this....

@knisht
Copy link
Collaborator Author

knisht commented Jul 13, 2022

Turns out no one suspected that it is possible. Ironically, I have this approach implemented in my other plugin (https://github.com/JetBrains/intellij-community/blob/master/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/groovy.bnf), and it is fine there. But I thought that Arend has generated PSI for some reason.

@ice1000
Copy link
Collaborator

ice1000 commented Jul 13, 2022

Ironically, this will save us lots of time and cleans up many confusing code in intellij-arend if we adapted this approach from the beginning...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants