Invalidation of all PSI when there's a filesystem change?


As of 2017.3.1 we notice that calls "invalidateAllPsi()" as part of its "rootsChanged()" method.

This is a very destructive change for us -- it causes all of our DOM-based editors to blank out and need to be closed and re-opened whenever the fsnotifier notices changes. (One of the scenarios where this seems to happen is compilation, but there are others.)

How is a DOM-based editor expected to respond to this invalidation? Can someone point me to an example of how to do this properly?


Comment actions Permalink

Putting a breakpoint to com.intellij.psi.impl.file.impl.FileManagerImpl#invalidateAllPsi should reveal the stack trace of the invalidation. But anyway, this means that that control probably isn't using stable copies. Debugger could show that: there should be StableInvocationHandler as a field inside the associated DomElement.


Please sign in to leave a comment.