find usages / replace with non-PSI trees

hiya. I'm continuing with my integration of ANTLR parse trees into intellij functionality (to avoid PSI trees) and see that all FindUsagesHandler/FindUsagesProvider stuff relies upon PSI trees.

Question: is there a way to reuse some of the find / replace functionality without relying on PSI trees?

If no, is there a way I can mirror my parse trees with PSI trees *without* requiring intellij parser/lexer infrastructure?

Thanks!
Ter

0
1 comment

All interesting functionality of IntelliJ depends on the PSI. You'll be able to get some features working, but you'll need to reimplement tons of stuff which is already there.

If you already have an AST built with ANTLR, it should be fairly easy to transform it to a PSI tree. You need a lexer that will return a token corresponding to each node in the tree, and a PsiParser that will add PsiBuilder markers according to the structure of the AST.

0

Please sign in to leave a comment.