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

VSC generic error messages #274

Open
mstormi opened this issue Jun 1, 2021 · 3 comments
Open

VSC generic error messages #274

mstormi opened this issue Jun 1, 2021 · 3 comments

Comments

@mstormi
Copy link

mstormi commented Jun 1, 2021

latest VSC (1.0) used with DSL rules

I quite often get error messages like the one below, repeatedly. LSP seems to stop working then (I gthink it recovers after some time but not sure).
That one was right after starting VSC then hovering above a DSL item (making LSP retrieve it, but LSP was busy), but it also happens after VSC has been up in a while.
I have NO idea what to look after.

openHAB vscode extension has been activated
[Error - 10:24:52] Request textDocument/definition failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.ClassCastException: class org.eclipse.xtext.common.types.access.TypeResource cannot be cast to class org.eclipse.xtext.resource.XtextResource (org.eclipse.xtext.common.types.access.TypeResource is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @aff928; org.eclipse.xtext.resource.XtextResource is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @595d55)
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
	at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class org.eclipse.xtext.common.types.access.TypeResource cannot be cast to class org.eclipse.xtext.resource.XtextResource (org.eclipse.xtext.common.types.access.TypeResource is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @aff928; org.eclipse.xtext.resource.XtextResource is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @595d55)
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:436)
	at org.eclipse.xtext.ide.server.findReferences.WorkspaceResourceAccess.readOnly(WorkspaceResourceAccess.java:36)
	at org.eclipse.xtext.ide.server.symbol.DocumentSymbolService.doRead(DocumentSymbolService.java:332)
	at org.eclipse.xtext.ide.server.symbol.DocumentSymbolService.getDefinitions(DocumentSymbolService.java:112)
	at org.eclipse.xtext.ide.server.symbol.DocumentSymbolService.getDefinitions(DocumentSymbolService.java:99)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$definition$24(LanguageServerImpl.java:608)
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:438)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.definition(LanguageServerImpl.java:607)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.definition(LanguageServerImpl.java:595)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$definition$23(LanguageServerImpl.java:586)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more

@mstormi mstormi added the bug label Jun 1, 2021
@mstormi mstormi changed the title VSC VSC generic error messages Jun 1, 2021
@Confectrician
Copy link
Collaborator

I doubt that we can do much here on the extension side.
Extension just opens a connection to the remote server which is implemented in openHAB core.
Every error message is generated there and just shown in the extension.

I have seen those messages too and i am unsure myself where and how to look for the problems root.
Also i am not involved in how the LSP is implemented. Maybe @wborn can bring some light in the dark.
He fixed some issues for that part in the past.

@wborn
Copy link
Member

wborn commented Jun 3, 2021

I haven't had time to look into these warnings. Maybe I find that one day. These warnings aren't that critical to me as that one issue I fixed one day where nothing worked. 😉

@Confectrician
Copy link
Collaborator

I have already tried to catch those errors in vscode and provide a more readable message, but that did not work as expected.

I think we can configure if and how often LSP server will try reconnecting after a failure, tough i am not sure about the best option to choose then.

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

No branches or pull requests

3 participants