Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking XML CodeLens link results in Unhandled event loop exception #644

Open
howlger opened this issue Feb 28, 2021 · 5 comments
Open

Comments

@howlger
Copy link
Contributor

howlger commented Feb 28, 2021

In the eclipseide-wild-web-developer-0.11.5-win32.win32.x86_64.zip I get an Unhandled event loop exception when clicking on a <n> reference(s) XML CodeLens link.

Steps to reproduce using the following sample.dtd file:

<!ELEMENT sample (foo, bar)>
<!ELEMENT foo (bar*)>
<!ELEMENT bar (#PCDATA)>
  1. In Window > Preferences: XML (Wild Web Developer) > CodeLens tick the Enable XML CodeLens checkbox (see XML CodeLens preference page #636)
  2. Open sample.dtd file (see above)
  3. Klick on the 1 reference (above line 2) or 2 references (above line 3) XML CodeLens link

Result:

  • Expected: Any kind of navigation to the clicked reference(s)
  • Actual: No navigation; instead, the following Unhandled event loop exception will be logged:
eclipse.buildId=4.18.0.I20201202-1800
java.version=15.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.wildwebdeveloper.product.branding.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.wildwebdeveloper.product.branding.product

org.eclipse.ui
Error
Sun Feb 28 22:18:43 CET 2021
Unhandled event loop exception

java.lang.IllegalArgumentException: The handle object must not have a zero-length identifier
	at org.eclipse.core.commands.common.HandleObjectManager.checkId(HandleObjectManager.java:65)
	at org.eclipse.core.commands.CommandManager.getCommand(CommandManager.java:522)
	at org.eclipse.ui.internal.commands.CommandService.getCommand(CommandService.java:159)
	at org.eclipse.lsp4e.command.CommandExecutor.createEclipseCoreCommand(CommandExecutor.java:212)
	at org.eclipse.lsp4e.command.CommandExecutor.executeCommandClientSide(CommandExecutor.java:185)
	at org.eclipse.lsp4e.command.CommandExecutor.executeCommand(CommandExecutor.java:107)
	at org.eclipse.lsp4e.operations.codelens.LSPCodeMining.performAction(LSPCodeMining.java:79)
	at org.eclipse.jface.text.source.inlined.InlinedAnnotationSupport$MouseTracker.mouseUp(InlinedAnnotationSupport.java:318)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:224)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	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:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	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:1461)

By the way, why it is called CodeLens which is a trademark owned by Microsoft and not Code Minings in Eclipse (see also Eclipse bug 526969 comment 15)?

@howlger howlger changed the title Unhandled event loop exception when clickin on an XML CodeLens link Unhandled event loop exception when clicking on an XML CodeLens link Feb 28, 2021
@howlger howlger changed the title Unhandled event loop exception when clicking on an XML CodeLens link Unhandled event loop exception when clicking XML CodeLens link Feb 28, 2021
@howlger howlger changed the title Unhandled event loop exception when clicking XML CodeLens link Clicking XML CodeLens link results in Unhandled event loop exception Feb 28, 2021
@angelozerr
Copy link
Contributor

As I explained here #637 (comment) WWD should implement the XML references command which should execute the same action than Find references.

For CodeLens, it's a LSP definition, @mickaelistria do you think should we update with Code Mining?

@mickaelistria
Copy link
Contributor

Are XML Code Lens on by default?
Yes, I think we should use Code Mining in Eclipse IDE as it's the term used in JDT as well.

@howlger
Copy link
Contributor Author

howlger commented Mar 1, 2021

XML CodeLens are disabled by default.

@angelozerr
Copy link
Contributor

IMHO, LSP should provide some standardization for command IDs, see microsoft/vscode-languageserver-node#495 (comment)

@mickaelistria
Copy link
Contributor

IMHO, LSP should provide some standardization for command IDs

Doing things 1 step at a time is a better approach than expecting a big standardization. For this case, it would be better that LSP standardizes a client/showLocations server-to-client operation, which would take as input a bunch of locations and would show it where it fits best (eg in the Search view for Eclipse IDE). The clicking the references code mining would cascade to invocation of a server side command, that server would then turn into a client/showLocations message for client to process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants