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
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...