EditorTextFields being disposed across all open projects when one project closed

I'm using EditorTextFields in tool windows in my plugin.  When multiple projects are opened with these tool windows showing and you close one project, the EditorTextFields in other projects are disposed and the component region turns into a green box.  The problem is easily remedied by toggling the tool window after which the EditorTextField is back as if nothing had happened, but obviously this behavior is not ideal.

Any idea why this would be happening and what I might be able to do to prevent it?  I'm creating the EditorTextField components using:

ServiceManager.getService(project, EditorTextFieldProvider.class).getEditorField(MyLanguage.INSTANCE, project, editorCustomizationFeatures);

after which I add the EditorTextField to my tool window's layout.

I've been registering each tool window tab's content with the Disposer for the containing project:

Content content = toolWindow.getContentManager().getFactory().createContent(...);
Disposer.register(project, content);

and thought that might be contributing, but the problem still occurs even when I remove that Disposer registration.

It seems odd to me that closing one project would cause this behavior in all other open projects.  Any thoughts are sincerely appreciated!


Are you sure that project you're using to create EditorTextField matches the project, where tool window is added?

Try to put a breakpoint into EditorImpl.release() and see the stack trace causing editor release (also, please post the stack trace here).


Dmitry, thanks to your advice to set a breakpoint in EditorImpl.release(), I found the issue, and I was doing it to myself.  Thanks so much for the response!


Please sign in to leave a comment.