Best way to force PsiFile to reparse contents?

For performance reasons our language plugin creates a lighter weight, transient psi tree in response to direct modifications in the active editor. This lighter weight psi tree is not suitable for our annotator, so the annotator forces the corresponding psiFile to reparse via psiFile.onContentReload(), but this feels a bit heavy-handed. Is there a better way to force a psiFile to reparse? Thanks.

2 comments
Comment actions Permalink

I don't think there is a better way. The requirement to force the reparse of PsiFile was not part of our original design, and the onContentReloaded() is kind of an official workaround for this.

0
Comment actions Permalink

Ok. Thanks for the quick reply Dmitry.

0

Please sign in to leave a comment.