Skip to content

URGENT: Fix startup issue for language server caused by lsp4j 0.15 upgrade #385

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

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

themkat
Copy link
Collaborator

@themkat themkat commented Aug 23, 2022

Sorry @fwcd , seems like I was too quick to approve a recent PR:
#381

lsp4j 0.15 causes the following startup issue in many clients:

Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$2(GenericEndpoint.java:83)
	at org.eclipse.lsp4j.jsonrpc.services.AnnotationUtil.findDelegateSegments(AnnotationUtil.java:32)
	at org.eclipse.lsp4j.jsonrpc.services.AnnotationUtil.findDelegateSegments(AnnotationUtil.java:28)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.recursiveFindRpcMethods(GenericEndpoint.java:74)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.<init>(GenericEndpoint.java:54)
	at org.eclipse.lsp4j.jsonrpc.services.ServiceEndpoints.toEndpoint(ServiceEndpoints.java:72)
	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.createRemoteEndpoint(Launcher.java:348)
	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.create(Launcher.java:320)
	at org.eclipse.lsp4j.launch.LSPLauncher.createServerLauncher(LSPLauncher.java:90)
	at org.javacs.kt.MainKt.main(Main.kt:44)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$2(GenericEndpoint.java:76)
	... 9 more
Caused by: java.lang.UnsupportedOperationException
	at org.eclipse.lsp4j.services.LanguageServer.getNotebookDocumentService(LanguageServer.java:93)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	... 11 more

The issue has been fixed in a later commit in lsp4j (probably included in next version 0.16). I was able to do the same in our language server and fix the startup issues.
eclipse-lsp4j/lsp4j@04b0c61

Emacs gives a warning of a null value, but ignores it. VSCode works like a charm when I tested it just now.

Again, sorry for not noticing this before I approved the other PR 🙁

@fwcd
Copy link
Owner

fwcd commented Aug 23, 2022

Thanks a lot for finding and fixing this! Curious that this didn't come up during the test suite.

@fwcd fwcd merged commit 6484b9b into fwcd:main Aug 23, 2022
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 this pull request may close these issues.

2 participants