What is the lifecycle of a PsiElement?

Can I store it in a table model, display it in the GUI and use it to navigate to the element when the user double clicks a row?

What's a better mechanism to do so?

0
1 comment
Avatar
Permanently deleted user

The general lifecycle of PsiElement is up to next reparse invalidating it. If you are showing modal dialog, then you can rely on no typing in the editor (unless of course this is the editor embedded in your dialog) and store PsiElements. Alternatively you can work with SmartPsiElementPointer that represent the best effort to restore the element after it has been invalidated.

0

Please sign in to leave a comment.