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

Error while hovering over Maven artifacts / broken #820

Closed
vrubezhny opened this issue Sep 21, 2023 · 16 comments · Fixed by #870
Closed

Error while hovering over Maven artifacts / broken #820

vrubezhny opened this issue Sep 21, 2023 · 16 comments · Fixed by #870

Comments

@vrubezhny
Copy link
Contributor

Original issue by @eliasbalasis: eclipse-lemminx/lemminx-maven#513

On Eclipse 2023-09
hovering over any Maven artifact
has now stopped producing the desired popup.

The following error is produced in "Error Log" view

org.eclipse.swt.SWTException: Object doesn't support property or method 'getComputedStyle'
	at org.eclipse.swt.browser.WebBrowser$EvaluateFunction.function(WebBrowser.java:195)
	at org.eclipse.swt.browser.WebSite.Invoke(WebSite.java:809)
	at org.eclipse.swt.browser.WebSite$7.method6(WebSite.java:182)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:120)
	at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
	at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:65)
	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:575)
	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:538)
	at org.eclipse.swt.browser.IE.execute(IE.java:1202)
	at org.eclipse.swt.browser.WebBrowser.nonBlockingExecute(WebBrowser.java:400)
	at org.eclipse.swt.browser.WebBrowser.evaluate(WebBrowser.java:450)
	at org.eclipse.swt.browser.WebBrowser.evaluate(WebBrowser.java:406)
	at org.eclipse.swt.browser.Browser.evaluate(Browser.java:665)
	at org.eclipse.swt.browser.Browser.evaluate(Browser.java:614)
	at org.eclipse.lsp4e.operations.hover.FocusableBrowserInformationControl.lambda$0(FocusableBrowserInformationControl.java:102)
	at org.eclipse.swt.browser.ProgressListener$2.completed(ProgressListener.java:98)
	at org.eclipse.swt.browser.IE.lambda$6(IE.java:656)
	at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(OleEventTable.java:58)
	at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(OleEventSink.java:160)
	at org.eclipse.swt.ole.win32.OleEventSink.Invoke(OleEventSink.java:128)
	at org.eclipse.swt.ole.win32.OleEventSink$1.method6(OleEventSink.java:79)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:120)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658)
	at org.eclipse.jface.internal.text.html.BrowserInformationControl.setVisible(BrowserInformationControl.java:357)
	at org.eclipse.jface.text.AbstractInformationControlManager.showInformationControl(AbstractInformationControlManager.java:1240)
	at org.eclipse.jface.text.TextViewerHoverManager.showInformationControl(TextViewerHoverManager.java:276)
	at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1191)
	at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1120)
	at org.eclipse.jface.text.AbstractHoverInformationControlManager.presentInformation(AbstractHoverInformationControlManager.java:884)
	at org.eclipse.jface.text.TextViewerHoverManager.doPresentInformation(TextViewerHoverManager.java:237)
	at org.eclipse.jface.text.TextViewerHoverManager.lambda$3(TextViewerHoverManager.java:227)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4047)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3663)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	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:645)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:552)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
	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:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	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:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)

Session Data:

eclipse.buildId=4.29.0.20230907-1200
java.version=17.0.8.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
@eliasbalasis
Copy link

I noticed that only LSP4E 0.17.1 seems to be included in Eclipse 2023-09 which seems quite outdated with 0.24.1 being the latest.
Is it possible that a fix has been introduced in more recent version of LSP4E and needs to be included in the release?

@jonahgraham
Copy link
Contributor

In version 0.24.1 of the overall LSP4E release the main LSP4E bundle org.eclipse.lsp4e is correctly at 0.17.1.

The debug bundle is 0.15.3 and the jdt one is 0.11.0. You can see all the bundles in the release in the download p2 site https://download.eclipse.org/lsp4e/releases/0.24.1/plugins/

The bundle versions are not updated when there is no change between releases, and when it is smaller changes only the last segment gets bumped.

I'm not sure what the full rule LSP4E follows for version bumping and it is somewhat affected by LSP4J which does not quite follow semantic API versioning because we try to keep API matching the LSP spec which does not always map prefectly to Java.

HTH.

@mickaelistria
Copy link
Contributor

I'm not sure what the full rule LSP4E follows for version bumping

It more or less tries to follow https://wiki.eclipse.org/Version_Numbering

@eliasbalasis
Copy link

It is rather confusing that the Eclipse plugin versions are different, but I understand the reasons.

However, the problem is still active and I do recall the given action working in the recent past, on Eclipse 2023-06 with updates.

Is something perhaps broken in more recent versions of LSP4E?

Is there any information I could capture that could help you further?

@mickaelistria
Copy link
Contributor

The issue seems to come from undelying browser integration. getComputedStyle doesn't seem to exist on all browsers (yours seems to be IE). I'm not familiar enough with browsers to know whether and how hard it would be to find a proper solution in LSP4E, that would use some other method or something that exists on all browsers.
In any case, as a workaround, you could maybe try using a different default browser in your Eclipse IDE: Help > Preferences > General > Web Browser and select another web browser as default. I'm not sure this parameter is properly taken into account for internal hover display though...

@eliasbalasis
Copy link

I have done this already but without any success.

eclipse-lemminx/lemminx-maven#513 (comment)

@angelozerr
Copy link
Contributor

@eliasbalasis I suspect that you are using an old WebBrowser IE like IE 8 (see https://stackoverflow.com/questions/21899272/how-to-fix-window-getcomputedstyle-is-not-an-object-error)

If you select an another WebBroser as default, which stacktrace do you have? I think you should not have a stack trace with IE:

at org.eclipse.swt.browser.IE.execute(IE.java:1202)

@mickaelistria I think we should try/catch the evaluate of getComputedStyle, because forbid the show of the hover because margin cannot be computed correctly is very shame.

@eliasbalasis
Copy link

eliasbalasis commented Oct 2, 2023

The error is identical under any of the conditions I tested (after restarting Eclipse)

Microsoft Edge,
Chrome,
Internal Browser.

It seems to be using the "IE" variant regardless of choice.
org.eclipse.swt.browser.IE.execute(IE.java:1202)

I am afraid this is very important to us, our Maven hierarchy cannot be studied efficiently and our developers will struggle heavily, reducing our productivity.

It also makes Eclipse IDE useless to us, because we are stuck on a pre-built distribution of Eclipse 2021-03 which cannot be updated until all the bugs on all the relevant tools are fixed.

Is there anything that can be done about this?

@eliasbalasis
Copy link

It has been quite a while since last interaction.

Is there anything we can do about this?

@akurtakov
Copy link
Contributor

In order to try Edge you have to follow the https://www.eclipse.org/swt/faq.php#howuseedge . Please try and get back to us as this doesn't sound like lsp4e but more like swt issue to me.

@eliasbalasis
Copy link

Thanks @akurtakov

I share the same suspicion.
This does look like a SWT issue, the call stack is SWT specific.

I will try your suggestion.

@eliasbalasis
Copy link

This did not work with -Dorg.eclipse.swt.browser.DefaultType=chromium which produced the same error.

It did seem to be working with -Dorg.eclipse.swt.browser.DefaultType=edge though which displays the pop-up.

However, the link inside the pop-up is not opening.

@akurtakov
Copy link
Contributor

akurtakov commented Nov 8, 2023

This did not work with -Dorg.eclipse.swt.browser.DefaultType=chromium which produced the same error.

There is no way chromium would work as there is no such backend in SWT.

It did seem to be working with -Dorg.eclipse.swt.browser.DefaultType=edge though which displays the pop-up.

That's expected as more and more web stacks give on support for IE e.g. eclipse-platform/eclipse.platform.swt#840 .
It's high time that companies with interest in SWT on Windows coordinate with each other and higher/appoint someone to finish the issues with making Edge default backend for the SWT Windows port. There is no other viable solution I could think of as even if Chromium support is being added it would always be extra setup and download thus not as easy to use solution as OS's built-in web engine.

However, the link inside the pop-up is not opening.

That's probably one of the Edge integration bugs to be fixed. At least you should be one step ahead now (I hope).

@eliasbalasis
Copy link

Thanks for tracing this back to SWT.

That's probably one of the Edge integration bugs to be fixed. At least you should be one step ahead now (I hope).

I think can use Ctrl+Click which seems to be pointing to the same target,
until SWT is permanently fixed.

@akurtakov
Copy link
Contributor

I think can use Ctrl+Click which seems to be pointing to the same target, until SWT is permanently fixed.

SWT would not get fixed by itself :)

vrubezhny added a commit to vrubezhny/lsp4e that referenced this issue Nov 11, 2023
vrubezhny added a commit to vrubezhny/lsp4e that referenced this issue Nov 11, 2023
@vrubezhny vrubezhny linked a pull request Nov 11, 2023 that will close this issue
vrubezhny added a commit to vrubezhny/lsp4e that referenced this issue Nov 12, 2023
mickaelistria pushed a commit that referenced this issue Nov 12, 2023
@eliasbalasis
Copy link

On Eclipse 2023-09 with m2e 2.4.0
-Dorg.eclipse.swt.browser.DefaultType=edge is not needed anymore on Windows OS.

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

Successfully merging a pull request may close this issue.

6 participants