Hello! I'm looking forward to being able to use clojure-lsp鈥攖hanks for all the hard work done on putting out an LSP for this incredible language! I'm not experienced with sending issues on GitHub and so I hope I'm doing the appropriate thing here.
As you can tell from the error output, I'm using the kakoune editor to try and edit Clojure files. Sadly, although I've gone so far as to set it up with clojure-lsp, I can't get it working at all. All that happens is that when I try to use LSP commands in the editor, the editor is stuck waiting for LSP to respond. Then upon leaving, it puts out this error:
Log - client <-> server
Apr 27 20:07:15.036 INFO Waiting for Messages from language server to finish..., module: kak_lsp::thread_worker:18
Apr 27 20:07:15.053 ERRO Language server error: Apr 27, 2021 8:06:49 PM org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError
SEVERE: Unable to invoke no-args constructor for class org.eclipse.lsp4j.WorkspaceEditChangeAnnotationSupportCapabilities. Registering an InstanceCreator with Gson for this type may fix this problem.
java.lang.RuntimeException: Unable to invoke no-args constructor for class org.eclipse.lsp4j.WorkspaceEditChangeAnnotationSupportCapabilities. Registering an InstanceCreator with Gson for this type may fix this problem.
at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:228)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:212)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.Gson.fromJson(Gson.java:932)
at org.eclipse.lsp4j.adapters.InitializeParamsTypeAdapter.readCapabilities(InitializeParamsTypeAdapter.java:151)
at org.eclipse.lsp4j.adapters.InitializeParamsTypeAdapter.read(InitializeParamsTypeAdapter.java:109)
at org.eclipse.lsp4j.adapters.InitializeParamsTypeAdapter.read(InitializeParamsTypeAdapter.java:34)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
at com.google.gson.Gson.fromJson(Gson.java:932)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.fromJson(MessageTypeAdapter.java:329)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.parseParams(MessageTypeAdapter.java:249)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:119)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:55)
at com.google.gson.Gson.fromJson(Gson.java:932)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:119)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:114)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:193)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:553)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java:566)
at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:50)
at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:225)
... 30 more
Caused by: java.lang.IllegalArgumentException: Class org.eclipse.lsp4j.WorkspaceEditChangeAnnotationSupportCapabilities is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection
at com.oracle.svm.core.graal.snippets.SubstrateAllocationSnippets.hubErrorStub(SubstrateAllocationSnippets.java:261)
at sun.misc.Unsafe.allocateInstance(Unsafe.java:840)
... 33 more
, module: kak_lsp::language_server_transport:60
I'm not sure how you could reproduce this, but maybe someone will at least recognize the error! My clojure-lsp version number is 2021.04.23-15.49.47, and I've installed it onto Ubuntu using the release binaries. When I check to see if closure-lsp works in the command line, it responds as expected to inputted text.
I have a lot of .out files, but they all seem to show the same thing, except for a couple which are empty:
Log - /tmp/clojure-lsp.*.out
... INFO [clojure-lsp.main:391] - Starting server... ... DEBUG [clojure-lsp.nrepl:24] - nrepl not found, skipping nrepl server start...
Thanks for any help you can provide.
Hey @Nagyhal thanks for the kind worlds and the report!
I indeed know what is happening :) It seems a graalvm reflection config missing related with the WorkspaceEditChangeAnnotationSupportCapabilities class, for some reason the other editors (VScode, Emacs, vim) don't use/call this LSP functionality so that's why we didn't catch this error before, I'll make a quick fix and a release later today for you to test the changes :)
Fixed on master, I should release the next version soon today, any new issues with this editor, feel free to open a new issue, and hopefully, if everything works we can add a new entry for that editor here :)
Brilliant鈥擨'd be happy to write a brief guide to using Clojure on kakoune as well. Looking forward to the update!
@Nagyhal the latest release should fix that issue, LMK if any other issues
Most helpful comment
Fixed on master, I should release the next version soon today, any new issues with this editor, feel free to open a new issue, and hopefully, if everything works we can add a new entry for that editor here :)