bkilinc
bkilinc

Reputation: 989

Compare editor not working on eclipse on node.js project

In other instance of eclipse (PHP, Java) I can use compare editor.

In one instance with "node.js Developer Tools" installed, compare editor does not show anything (just a blank grey view). Instead the error view shows the error Unhandled event loop exception (see below).

The strange thing is on same eclipse instance when I create a new project, compare editor works. I totally cleaned up project (deleting .project, .settings, .tern-project files) re-imported in workspace and problem persists.

Complete error message for Unhandled event loop exception:

org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.jface.text.Position.<init>(Position.java:62)
at org.eclipse.compare.structuremergeviewer.DocumentRangeNode.registerPositionUpdater(DocumentRangeNode.java:115)
at org.eclipse.compare.structuremergeviewer.DocumentRangeNode.<init>(DocumentRangeNode.java:110)
at org.eclipse.wst.jsdt.internal.ui.compare.JavaNode.<init>(JavaNode.java:53)
at org.eclipse.wst.jsdt.internal.ui.compare.JavaParseTreeBuilder.push(JavaParseTreeBuilder.java:139)
at org.eclipse.wst.jsdt.internal.ui.compare.JavaParseTreeBuilder.visit(JavaParseTreeBuilder.java:66)
at org.eclipse.wst.jsdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:368)
at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
at org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement.accept0(TypeDeclarationStatement.java:213)
at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
at org.eclipse.wst.jsdt.core.dom.JavaScriptUnit.accept0(JavaScriptUnit.java:242)
at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
at org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureCreator.createStructureComparator(JavaStructureCreator.java:285)
at org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureCreator.createStructureComparator(JavaStructureCreator.java:243)
at org.eclipse.compare.structuremergeviewer.StructureCreator.internalCreateStructure(StructureCreator.java:118)
at org.eclipse.compare.structuremergeviewer.StructureCreator.access$0(StructureCreator.java:106)
at org.eclipse.compare.structuremergeviewer.StructureCreator$1.run(StructureCreator.java:93)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.compare.internal.Utilities.runInUIThread(Utilities.java:805)
at org.eclipse.compare.structuremergeviewer.StructureCreator.createStructure(StructureCreator.java:99)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$StructureInfo.createStructure(StructureDiffViewer.java:174)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$StructureInfo.refresh(StructureDiffViewer.java:152)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$StructureInfo.setInput(StructureDiffViewer.java:123)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.compareInputChanged(StructureDiffViewer.java:374)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$2.run(StructureDiffViewer.java:92)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$5.run(StructureDiffViewer.java:349)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.compareInputChanged(StructureDiffViewer.java:345)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.compareInputChanged(StructureDiffViewer.java:333)
at org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureDiffViewer.compareInputChanged(JavaStructureDiffViewer.java:143)
at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.inputChanged(StructureDiffViewer.java:302)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:286)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1685)
at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:270)
at org.eclipse.compare.internal.CompareStructureViewerSwitchingPane.setInput(CompareStructureViewerSwitchingPane.java:139)
at org.eclipse.compare.CompareEditorInput.feedInput(CompareEditorInput.java:753)
at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:553)
at org.eclipse.compare.internal.CompareEditor.createCompareControl(CompareEditor.java:444)
at org.eclipse.compare.internal.CompareEditor.access$6(CompareEditor.java:404)
at org.eclipse.compare.internal.CompareEditor$1$1.run(CompareEditor.java:361)
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:58)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:168)
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:150)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4497)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4110)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

Upvotes: 3

Views: 1205

Answers (1)

Tobias Liefke
Tobias Liefke

Reputation: 9022

This is a bug in the structure view of the compare editor.

Workaround until the bug is fixed:

Open Window / Preferences from the menu and go to the node General / Compare/Patch. There you uncheck the option Open structure compare automatically:

Open structure compare automatically

That will prevent rendering the upper structure compare part (which is of no use for those kind of files anyway) but will keep the lower side by side view.

Upvotes: 8

Related Questions