Fork me on GitHub
Marc O'Morain15:12:47

I see this in Calva when I try to run with a the latest LSP: I can’t for the life of me read that little icon 😄 Is it an error?

Marc O'Morain16:12:09

I’m attempting to call 'clojure/textDocument/testTree' and getting “Unsupported Request Method”, so I’m trying to debug what I’m doing wrong. Assume it’s something on my end.


Never saw that icon :man-shrugging:


@U0K592YDP is not a method, but a server notification


you won't call it manually, server will return that Everytime a new filé is open/changed


So you can cache/save data to show in a future tree open request from user or something else

Marc O'Morain16:12:16

aha, so I listen for those events :thumbsup:


BTW @U0K592YDP, are you using local clojure-lsp? This feature is available only on master until next release


There is a calva option to set a local clojure-lsp path

Marc O'Morain17:12:17

What’s the easiest way to install master? checkout and build?


checkout and run make

Marc O'Morain17:12:54

Loving the docs 👏

🎉 1
Marc O'Morain17:12:19

I’m getting close > Exception in thread “main” java.lang.UnsupportedClassVersionError: clojure_lsp/feature/test_tree/TestTreeParams has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 60.0


you compiled clojure-lsp with javac 17 or something and is running with java 15 or older


it's best if you use graalvm for both the uberjar and the native aot


he is using for development only @U04V15CAJ


the clj-kondo compile script forces this by setting the path and java_home to GRAALVM_HOME


yes, regardless


and also the next line

Marc O'Morain18:12:04

@UKFSJSM38 do you have a macOS binary built?


not really, I use Linux :/


IMO you can use the JVM one, as it is for development only, it's the one I use when developing, but if you wanna use the graalvm you can follow:


That’s an esc icon. It has nothing to do with lsp version, I think. I don’t know how, but probably I have fat-fingered in an escape character in the printout.

😆 3

Indeed. It seems the VS Code team has focused on helping with highlighting funny characters like that lately.

Marc O'Morain11:12:41

I don’t have the right dependencies on my machine, so I wasn’t able to get this to build.

Marc O'Morain11:12:53

But then I remembered that I know a little about CI

Marc O'Morain11:12:18 ^ This makes CI create binaries on macOS and Linux 🎉


@U0K592YDP it was on purpose to not generate multiple binaries on CI :/ It's too heavy to keep building with GraalVM every push to GitHub, that's why we do that only for Linux, but test all windows Linux and macos during the releas


We test Linux just to make sure there is no bug bug related to reflection or something


And leave the corner cases to fail during release which usually doesn't happen


You should be using CircleCI for this, it's much faster, especially when they give you the upgraded plan ;)


(but yes, this makes sense, limiting to linux on push)


Yeah, I'm not a big fan of circle ci, and this was never a issue to clojure-lsp repo I think, the CI usually works ready good and the whole automatic release as well


I'm the reverse, at least when it comes to performance, I find CircleCI way better


and being able to ssh into containers 💕


Yes, that's handy indeed

Marc O'Morain12:12:26

How do you build the macOS binaries when you do a release?

Marc O'Morain13:12:22

(and why not publish a new release on every master build?)

Marc O'Morain13:12:22

aha, thanks. So if I need a binary I can trigger that workflow :thumbsup:


releasing a binary on every master build is what I do with clj-kondo and babashka, but I don't publish them, I just overwrite in the snapshot release. Note that this will yield a lot of garbage releases if you would do this as official releases

☝️ 1

you can just test with the uberjar in development

Marc O'Morain13:12:55

I tried the uberjar, but I ended up in the same situation where my local JVM was not the version that had compiled the class files.


compile using java 8


I mean, create the uberjar yourself, that isn't too hard


actually I think lsp should also compile using java 8 for their uberjar


we compile with java8 at CI to release


@U0K592YDP’s issue sounds like, he's compiling with java X but running with java Z

Marc O'Morain13:12:35

[email protected] ~/dev/clojure-lsp $ make clean
rm -rf classes clojure-lsp clojure-lsp.jar docs/
[email protected] ~/dev/clojure-lsp $ clojure -X:prod-jar
Downloading: com/google/code/gson/gson/maven-metadata.xml from central
Synchronizing pom.xml
Skipping paths: classes resources
Compiling clojure-lsp.main ...
Execution error (ClassNotFoundException) at (

Full report at:

Compilation failed!
Execution error (ExceptionInfo) at hf.depstar.uberjar/build-jar-as-exec (uberjar.clj:554).
AOT compilation failed

Full report at:
[email protected] ~/dev/clojure-lsp $

Marc O'Morain13:12:50

[email protected] ~/dev/clojure-lsp $ cat /var/folders/q0/2g2lcf6j79df6vxqm0cg_0zm0000gn/T/clojure-1120159636839573834.edn
 "Execution error (ClassNotFoundException) at (\nclojure_lsp.feature.test_tree.TestTreeParams\n",
 {:clojure.error/class java.lang.ClassNotFoundException,
  :clojure.error/line 440,
  :clojure.error/cause "clojure_lsp.feature.test_tree.TestTreeParams",
  :clojure.error/source "",
  :clojure.error/phase :execution},

Marc O'Morain13:12:45

anyway, I was able to use GH Actions to get the binary that I need to continue loading a Test Tree

🎉 2

@U0K592YDP about the first stacktrace, you ran make clean and run a clojure alias manually, but you didn't compile the classes clojure-lsp require, you can just run make and it should generate everything correctly

Marc O'Morain13:12:27

2021-12-16T13:36:58.170Z INFO [clojure-lsp.producer:?] - :testTree 0.00 secs I can see this in the LSP logs 🎉

Marc O'Morain13:12:48

Time to find out how to get the client to subscribe the test tree events now…


@U0K592YDP search for clientCapabilities


you need to send {"experimental": {"testTree": true}}

Marc O'Morain15:12:51

FYI: I’m getting top level keys uri: string and tree: TestTreeNode

Marc O'Morain15:12:59

(The docs might need to be updated)


ops, I'll fix it

Marc O'Morain15:12:18

I have it all wired up, now, and I now have to do a little dance to make VSCode and Clojure LSP work together. VSCode fires a callback when it wants to load tests, and the LSP is firing a callback when it discovers a test.


yes, makes sense

Marc O'Morain15:12:24

It feels like I have two male USB connectors, and I can’t plug them together. So I need to create some sort of USB hub using a promise or an iterator or something 🙂


good comparison 😂


You probably need to create an empty promise first


that was a joke

Marc O'Morain15:12:02

In doing some research I found the with-test macro, which is shown here. Clojure LSP is not finding those tests.


Yeah, it will work only with the default ones for now


I talked with @U04V15CAJ about adding that to kondo, but it probably makes more sense to have that logic on lsp

Marc O'Morain15:12:34

I have never seen with-test in the wild, so not really a problem 🙂


Yeah, but there are other test frameworks like midje and state-flow


Which won't work for now


But I intend to add support in other release


gotta start somewhere

Marc O'Morain15:12:00

Is there a way to trigger the LSP to perform the action that will result in a TestTree item being sent back to the client?

Marc O'Morain15:12:38

Editing a file causes the scan for Test items to take place. VSCode suggests doing the scan when the user opens a file.


But we do send the notification when the file is open-end and if any changes


Tralala, releasing clj-kondo... o wait:

😂 1

Now it's working again :)