mbeddr/mbeddr.core

Cannot initialize documentation tool properly

Closed this issue · 1 comments

As reported by @alexanderpann, the documentation tool fails to initialize with the following exception in master:

java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.wm.ToolWindow.isVisible()" because the return value of "jetbrains.mps.ide.tools.BaseTool.getToolWindow()" is null
	at jetbrains.mps.ide.tools.BaseTool.toolIsOpened(BaseTool.java:101)
	at com.mbeddr.doc.aspect.ui.plugin.DocumentationHandler.lambda$showDoc$0(DocumentationHandler.java:60)
	at jetbrains.mps.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:80)
	at jetbrains.mps.smodel.ModelAccessBase.runReadAction(ModelAccessBase.java:56)
	at com.mbeddr.doc.aspect.ui.plugin.DocumentationHandler.showDoc(DocumentationHandler.java:38)
	at com.mbeddr.doc.aspect.ui.plugin.DocumentationProjectPlugin_ProjectPluginPart$1.selectionChangedTo(DocumentationProjectPlugin_ProjectPluginPart.java:25)
	at jetbrains.mps.nodeEditor.selection.SingularSelectionListenerAdapter.selectionChanged(SingularSelectionListenerAdapter.java:33)
	at jetbrains.mps.nodeEditor.selection.SelectionManagerImpl.doChangeSelection(SelectionManagerImpl.java:219)
	at jetbrains.mps.nodeEditor.selection.SelectionManagerImpl.setSelectionInfoStack(SelectionManagerImpl.java:176)
	at jetbrains.mps.nodeEditor.Memento.restore(Memento.java:185)

To reproduce, open mbeddr.doc + another project and start typing in a sandbox. The error message should appear immediately.

Confirmed to be fixed by using MPS 2022.2.1 instead of MSP 2022.2.
Seems to be coming back with MPS 2022.3, maybe the bugfix is missing there.