Fork me on GitHub
#lsp
<
2021-11-02
>
robert-stuttaford09:11:38

is there a way to stop the clojure-lsp std-err buffer from being created? i tab into it by accident and then my emacs needs to be force quit :face_palm:

ericdallo14:11:57

No, this is created automatically by lsp-mode for each server you start. Even so never saw this buffer cause any issues, I change to this buffer everytime I want to debug a error or something

robert-stuttaford16:11:57

i think it's because i've got a font with ligature support enabled

robert-stuttaford16:11:06

thanks for answering!

👍 1
ericdallo16:11:13

clojure-lsp  Released clojure-lsp https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.11.02-15.24.47 with more improvements and some new LSP features! • General ◦ Bump Graalvm from 21.2.0 to 21.3.0 improving binary performance/size ◦ Fix wrong parse of code when code contains namespaced maps like `#:foo{:bar 1}`. This issue was affecting a lot of features for example code actions. ◦ Bump datalevin from 0.5.26 to 0.5.27. ◦ Improve semantic tokens for dynamic vars, function definitions, namespaced and aliased keywords. ◦ Fix bug where `:source-paths` settings could be hot-reloaded with wrong-value. • Editor ◦ Deprecates setting `:show-docs-arity-on-same-line?` in favor of `:hover` `:arity-on-same-line?`. ◦ Add support to new LSP `LinkedEditingRange` feature. https://github.com/clojure-lsp/clojure-lsp/issues/341 ◦ Improve suggested `Add require ...` code actions, this should make clojure-lsp smarter when user wants to add a missing require. https://github.com/clojure-lsp/clojure-lsp/issues/614 ◦ Change `:notify-references-on-file-change` default from `false` to `true`, we had some performance improvements and I've been testing this for some time now and didn't see any new issues with that. This should improve a lot the UX when user change any code that is references on other files, updating the diagnostics for those files as well. ◦ Improve rename feature UX to output errors when it's not possible rename. ◦ Add support for `window/showDocument` LSP method, used on `create-test` command/code action after creating the test to show the test file. ◦ Add new `Unwind thread once` and `Unwind whole thread` code actions to undo a thread call. ◦ Improve code actions performance requesting async all actions. ◦ Add new LSP custom method `clojure/clojuredocs/raw` which takes a symbol and a namespace (both strings) and returns any Clojuredocs entry found, otherwise `null`. ◦ Fix missing keywords rename/references for destructured keywords. • CLI ◦ Show error/warning message when a classpath scan fail during analysis. Fixes https://github.com/clojure-lsp/clojure-lsp/issues/626 ◦ Add coloring to `diagnostics` output matching diagnostic severity. The highlights of this release are: • New code actions to unwind a thread call • Change `:notify-references-on-file-change` default value from false to true, which makes clojure-lsp notify other files when a change was made to a reference, Example: you change the function arity of the `foo` function from 1 to 2, then clojure-lsp will re-lint all usages/references of that function, making the diagnostics consistent with the whole project. • The huge improvement on the `Add missing require` code actions where clojure-lsp now try to infer some namespaces from alias like alias `f.bar` for ns `foo.bar`, please let me know if any corner case bugs on this one. • The new `LinkedEditingRange` feature which makes possible rename variables from the same buffer live, check the gif This release was supported by https://www.clojuriststogether.org/ clojurists-together gratitude

catjam 4
robert-stuttaford16:11:58

notify-references-on-file-change change is a huge QOL bump, thank you

ericdallo16:11:36

yeah, it's been some time I want to enable it by default, but the feature was with some performance issues, now I think it's good enough to be on by default :)

seancorfield21:11:00

I'm seeing this exception in the LSP log (in Calva/VS Code) with that latest version:

Nov 02, 2021 2:22:50 PM org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError
SEVERE: Unable to invoke no-args constructor for class org.eclipse.lsp4j.SetTraceParams. 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.SetTraceParams. 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.Gson.fromJson(Gson.java:963)
	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:963)
	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:596)
	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)
	... 19 more
Caused by: java.lang.IllegalArgumentException: Class org.eclipse.lsp4j.SetTraceParams 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:258)
	at sun.misc.Unsafe.allocateInstance(Unsafe.java:840)
	... 22 more
and I'm not getting proper semantic token coloring.

borkdude21:11:53

This could be a reflection issue. @UKFSJSM38

ericdallo21:11:34

Yes it is, I'll take a look

ericdallo21:11:29

According to lsp4j, it is related with

A notification that should be used by the client to modify the trace setting of the server.
It doesn't seem to block any clojure-lsp feature and it's not a new bug it seems, I'll include the fix on the next release

ericdallo21:11:34

thanks for the report @U04V70XH6

seancorfield21:11:23

Hmm, I wound back to 2021.10.20-16.49.47 and restarted and I'm still not getting proper semantic token coloring (strings and comments are white in the Dark+ theme in VS Code where they used to be brown and green respectively, as I recall from last week).

seancorfield21:11:53

OK, the trace exception above has nothing to do with the semantic token coloring. Seems to be an extension conflict in VS Code. Will debug and bring that up elsewhere...

seancorfield21:11:08

Interesting. I don't get the trace exception unless I have Clover enabled. With Clover disabled, it all works -- including coloring.

ericdallo21:11:03

that's odd, AFAICS this is a new LSP notification that happens when client change the trace settings: https://microsoft.github.io/language-server-protocol/specification#setTrace

ericdallo21:11:40

and probably started happen with the semantic tokens calva update that bumped the vscode-language-client package which included this new trace feature

ericdallo21:11:05

but my guess is that it has nothing related with clover

ericdallo21:11:42

anyway, I fixed on master, it should not throw any exception on next release

seancorfield22:11:44

Interesting. OK. But Clover does seem to interfere with coloring/token stuff somehow.

seancorfield22:11:25

(it's related to the Clojure grammar file -- I have a workaround: everything's fine now 🙂 )

👍 1