Modifying read-only PSI tree to add new PSI element
Answered
Is there any way to modify a read-only PSI file / tree? I would like to add javadoc data to some external lib java source files based on a different data source not directly embedded in the files. I understand that this could not be saved to disk, I just want to add a new PsiDocComment node to a PsiMethod in a read-only tree. Is this possible? Where would I inject a hook or add a listener to accomplish this?
Please sign in to leave a comment.
You could provide custom DocumentationProvider delegating to original one and wrap final generated docs shown in UI. https://plugins.jetbrains.com/docs/intellij/documentation-provider.html
Thank you! I'll try this.