Fork me on GitHub
#lsp
<
2023-05-01
>
seancorfield17:05:23

Not sure whether this is a Calva or LSP issue. Just got back from Conj and fired up my dev machine for the first time in nearly a week and LSP won't start, with this error:

[Error - 10:19:41 AM] Clojure Language Client client: couldn't create connection to server.
Launching server using command /home/sean/.vscode-server/extensions/betterthantomorrow.calva-2.0.353/clojure-lsp failed. Error: spawn /home/sean/.vscode-server/extensions/betterthantomorrow.calva-2.0.353/clojure-lsp ENOENT

ericdallo17:05:20

Looks like a calva issue, clojure-lsp process is not being initialized properly

seancorfield17:05:33

(~)-(!2001)-> ls -l /home/sean/.vscode-server/extensions/betterthantomorrow.calva-2.0.353/
total 29544
-rw-r--r-- 1 sean sean    95451 Apr 17 08:53 CHANGELOG.md
-rw-r--r-- 1 sean sean     1162 Apr 17 08:53 LICENSE.txt
-rw-r--r-- 1 sean sean    16305 Apr 17 08:53 README.md
drwxr-xr-x 6 sean sean     4096 Apr 17 08:53 assets
drwxr-xr-x 2 sean sean     4096 May  1 10:18 backup
drwxr-xr-x 2 sean sean     4096 Apr 17 08:53 bundled
-rw-r--r-- 1 sean sean 25279418 Apr 30 12:18 clojure-lsp-native-static-linux-amd64.zip
-rw-r--r-- 1 sean sean        7 Apr 30 12:18 clojure-lsp-version
-rw-r--r-- 1 sean sean    10282 Apr 17 08:53 clojure.tmLanguage.json
-rw-r--r-- 1 sean sean       12 Apr 17 09:27 deps-clj-version
-rw-r--r-- 1 sean sean  4700126 Apr 17 09:27 deps.clj.jar
-rw-r--r-- 1 sean sean      433 Apr 17 08:53 language-configuration.json
drwxr-xr-x 3 sean sean     4096 Apr 17 08:53 out
-rw-r--r-- 1 sean sean   105260 Apr 17 08:53 package.json
-rw-r--r-- 1 sean sean      789 Apr 17 08:53 snippets.jsonc
So it looks like maybe it tried to d/l a new version and failed?

ericdallo17:05:17

I think so, try removing it that zip and start calva again

seancorfield17:05:19

I had the LSP version set to nightly (presumably to test something). I reset it to latest, deleted clojure-lsp-* from that folder and reloaded VS Code and it seems to have started up fine now. Thanks for the pointer @ericdallo -- hope your trip back from Conj was smooth? Great to see you there!

borkdude18:05:25

@ericdallo Hope you updated clj-kondo, I implemented some new features yesterday :) (mostly this one: https://github.com/clj-kondo/clj-kondo/commit/4a1958312e4a8f57b487f1cf051bdb825b3341f1, but no sweat if you didn't)

pez18:05:00

clojure-lsp quite often has problems starting when VS Code is fired up after having had a pause for some time. I think it’s something in Calva’s updating of lsp that isn’t as it should, but it is elusive.

borkdude18:05:22

If you fill in "nightly" how often does it refresh the nightly?

ericdallo18:05:26

Thanks @U04V15CAJ I saw that, I always check kondo versions before releasing it, I should release a new minor version with some fixes, I should include kondo bump as well

🎉 1
borkdude18:05:57

FWIW I run clojure-lsp and clj-kondo from source, I can update them to the master version whenever I want, using this script:

seancorfield18:05:05

I switched Calva's config back to nightly and reloaded the window -- and LSP did not start.

seancorfield18:05:09

Switching it back to latest and reloading worked. So it looks like nightly is broken in Calva?

borkdude18:05:48

@U04V70XH6 for debugging: what about downloading the nightly manually and hardcoding the path in Calva?

☝️ 1
borkdude18:05:22

or if you know the path of the downloaded nightly: try to run it on the command line and add --version to see if it runs?

seancorfield19:05:49

@U04V15CAJ I don't care about specific nightly builds. Calva has a setting for latest vs nightly LSP versions and I expected it to handle that automatically (and I believe it used to work at some point). I mostly have it set to the default (`latest`) and just don't worry about it.

borkdude19:05:22

I appreciate you're testing the nightly build

pez19:05:10

I’ll make some tests with this tomorrow.

seancorfield04:05:23

@U0ETXRFEW If this helps (I've repro'd this several times now): I think Calva downloads the latest .zip but when it expands it, it moves clojure-lsp to backup folder after expansion. I was able to fix my local install for nightly by: a) deleting the .zip b) copying backup/clojure-lsp up one level c) restarting clojure-lsp in VS Code As long at the .zip file was present, Calva would unzip it and then move clojure-lsp into backup/ based on the file timestamps I was seeing. As soon as I took the .zip away (and moved clojure-lsp back), it stopped trying to mess with it -- but I assume it will do the same again when a new nightly build is available.

pez04:05:20

Thanks, @U04V70XH6 ! 🙏

seancorfield05:05:51

Ugh! I just reloaded the window and it moved clojure-lsp back to backup/ and now it won't start again...

seancorfield05:05:07

And clojure-lsp-version is 2023.04.19-12.43.29 which seems to be the latest nightly LSP release...

seancorfield05:05:48

> ./backup/clojure-lsp --version
clojure-lsp 2023.04.19-12.43.29
clj-kondo 2023.04.15-SNAPSHOT

seancorfield05:05:33

@ericdallo Not sure if this is useful info for you, given the above, but if I try to follow clojure-lsp's direct installation instructions for the nightly build, it fails:

> sudo ./install --version nightly
[sudo] password for sean:
Downloading  to /tmp/tmp.runCeGEJrI
[clojure-lsp-native-static-linux-amd64.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of clojure-lsp-native-static-linux-amd64.zip or
        clojure-lsp-native-static-linux-amd64.zip.zip, and cannot find clojure-lsp-native-static-linux-amd64.zip.ZIP, period.

ericdallo11:05:08

Thanks @U04V70XH6, I seems the CI build failed with a inconsistent state for some reason, https://github.com/clojure-lsp/clojure-lsp-dev-builds/releases/tag/2023.05.01-15.24.36-nightly I will re trigger it

ericdallo11:05:51

@U04V70XH6 should be fixed latest nightly (https://github.com/clojure-lsp/clojure-lsp-dev-builds/releases/tag/2023.05.01-15.24.36-nightly) (it seems it was some jar fetch error on build)

seancorfield16:05:54

It is indeed fixed now -- thanks, @ericdallo!

> ./clojure-lsp --version
clojure-lsp 2023.05.01-15.24.36-nightly
clj-kondo 2023.04.15-SNAPSHOT

👍 4
🎉 4
clojure-lsp 4