This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-13
Channels
- # adventofcode (36)
- # aleph (1)
- # announcements (7)
- # aws (4)
- # babashka (14)
- # beginners (61)
- # calva (79)
- # cider (19)
- # clojure (48)
- # clojure-austin (1)
- # clojure-australia (2)
- # clojure-czech (2)
- # clojure-europe (46)
- # clojure-france (8)
- # clojure-nl (19)
- # clojure-uk (4)
- # clojuredesign-podcast (14)
- # core-logic (42)
- # data-science (3)
- # datalevin (8)
- # datomic (76)
- # events (1)
- # figwheel-main (9)
- # fulcro (6)
- # helix (1)
- # holy-lambda (1)
- # honeysql (2)
- # jobs (2)
- # jobs-discuss (20)
- # leiningen (5)
- # lsp (87)
- # minecraft (11)
- # nextjournal (4)
- # off-topic (17)
- # practicalli (1)
- # reagent (22)
- # reitit (8)
- # releases (3)
- # rum (2)
- # shadow-cljs (18)
- # sql (11)
- # tools-build (5)
- # tools-deps (9)
- # xtdb (20)
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?
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.
@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
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
What’s the easiest way to install master? checkout and build?
:thumbsup:
More details here: https://clojure-lsp.io/development/
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
he is using for development only @U04V15CAJ
the clj-kondo compile script forces this by setting the path and java_home to GRAALVM_HOME
@UKFSJSM38 do you have a macOS binary built?
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: https://clojure-lsp.io/building/#graalvm
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.
Indeed. It seems the VS Code team has focused on helping with highlighting funny characters like that lately.
I don’t have the right dependencies on my machine, so I wasn’t able to get this to build.
But then I remembered that I know a little about CI
https://github.com/clojure-lsp/clojure-lsp/pull/669 ^ 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
You should be using CircleCI for this, it's much faster, especially when they give you the upgraded plan ;)
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
How do you build the macOS binaries when you do a release?
(and why not publish a new release on every master build?)
@U0K592YDP https://github.com/clojure-lsp/clojure-lsp/blob/master/.github/workflows/release.yml
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
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.
@U0K592YDP’s issue sounds like, he's compiling with java X but running with java Z
marc@blaster ~/dev/clojure-lsp $ make clean
rm -rf classes clojure-lsp clojure-lsp.jar docs/README.md
marc@blaster ~/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 java.net.URLClassLoader/findClass (URLClassLoader.java:440).
clojure_lsp.feature.test_tree.TestTreeParams
Full report at:
/var/folders/q0/2g2lcf6j79df6vxqm0cg_0zm0000gn/T/clojure-1120159636839573834.edn
Compilation failed!
Execution error (ExceptionInfo) at hf.depstar.uberjar/build-jar-as-exec (uberjar.clj:554).
AOT compilation failed
Full report at:
/var/folders/q0/2g2lcf6j79df6vxqm0cg_0zm0000gn/T/clojure-6206336463939364273.edn
marc@blaster ~/dev/clojure-lsp $
marc@blaster ~/dev/clojure-lsp $ cat /var/folders/q0/2g2lcf6j79df6vxqm0cg_0zm0000gn/T/clojure-1120159636839573834.edn
{:clojure.main/message
"Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:440).\nclojure_lsp.feature.test_tree.TestTreeParams\n",
:clojure.main/triage
{:clojure.error/class java.lang.ClassNotFoundException,
:clojure.error/line 440,
:clojure.error/cause "clojure_lsp.feature.test_tree.TestTreeParams",
:clojure.error/symbol java.net.URLClassLoader/findClass,
:clojure.error/source "URLClassLoader.java",
:clojure.error/phase :execution},
:clojure.main/trace
anyway, I was able to use GH Actions to get the binary that I need to continue loading a Test Tree
@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
2021-12-16T13:36:58.170Z INFO [clojure-lsp.producer:?] - :testTree 0.00 secs
I can see this in the LSP logs 🎉
Time to find out how to get the client to subscribe the test tree events now…
@U0K592YDP search for clientCapabilities
FYI: I’m getting top level keys uri: string
and tree: TestTreeNode
(The docs might need to be updated)
Fixed @U0K592YDP!
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.
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 🙂
In doing some research I found the with-test
macro, which is shown here. Clojure LSP is not finding those tests.
I talked with @U04V15CAJ about adding that to kondo, but it probably makes more sense to have that logic on lsp
I have never seen with-test
in the wild, so not really a problem 🙂
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?
Editing a file causes the scan for Test items to take place. VSCode suggests doing the scan when the user opens a file.
aha, thanks!