Synchronizing editor/repository after psi changes
My plugin does some code modifications via PSI only (in effect converting from a custom logging solution to log4j).
It more or less works, but there is a little issue:
I call replace() on a PsiMethodCallExpression. After that the file is marked red in the editor, though it still compiles fine.
When loading the project for the next time I get this exception:
2005-02-17 13:32:38,156 ERROR - impl.RepositoryElementsManager - Error synchronizing psi and repository in file: C:\Stephen\idea-sandbox\projects\logtest\src\Baa.java repositoryElementType: FIELD psiParent: PsiClass:Baa
java.lang.ArrayIndexOutOfBoundsException: 0
I guess I am missing something very basic here, like having to call some kind of commmit/update/synchronize method?!
Other changes worked fine, though...
请先登录再写评论。
You probably produce wrong PSI structure. Unfortunately our PSI is not
typesafe to guarantee you can't go wrong. Please post the code you use to
modify PSI to see if it is really the source of the problem.
Eugene.
"Stephen Kelvin" <mail@gremlin.info> wrote in message
news:30651922.1108649901725.JavaMail.itn@is.intellij.net...
>
from a custom logging solution to log4j).
marked red in the editor, though it still compiles fine.
>
Error synchronizing psi and repository in file:
C:\Stephen\idea-sandbox\projects\logtest\src\Baa.java repositoryElementType:
FIELD psiParent: PsiClass:Baa
>
kind of commmit/update/synchronize method?!
>