This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-16
Channels
- # ai (5)
- # announcements (47)
- # aws (11)
- # babashka (20)
- # beginners (85)
- # biff (1)
- # calva (72)
- # cider (9)
- # clj-kondo (37)
- # cljfx (9)
- # cljs-dev (1)
- # clojars (2)
- # clojure (61)
- # clojure-berlin (2)
- # clojure-europe (189)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-uk (2)
- # clojurescript (51)
- # conjure (3)
- # cursive (4)
- # data-science (6)
- # datomic (6)
- # events (5)
- # fulcro (16)
- # gratitude (9)
- # holy-lambda (9)
- # introduce-yourself (6)
- # lsp (13)
- # malli (8)
- # membrane (2)
- # off-topic (47)
- # pedestal (11)
- # re-frame (15)
- # reitit (1)
- # releases (2)
- # rewrite-clj (6)
- # rum (4)
- # shadow-cljs (2)
- # tools-deps (3)
- # xtdb (25)
- # yada (13)
Often enough... I think it starter for me a couple of days ago, maybe a week. I have not looked into it (because everything seems to still work).
It’s been fixed in latest clojure-lsp. You can confirm by using the nightly build. (Which is tricky if you're on an M1/2 Mac, but anyway.)
I know you said it's been fixed, but I figured it might be helpful to add that I see this most often when editing form comments (`#_`)
@U0ETXRFEW Is there a particular action I can do to trigger the bug on purpose?
Yes, you can ignore a binding in a let box or a map. Something like so:
{:a 1
:b 2
:c 3}
Then change that to:
{:a 1
:b 2
#_#_:c 3}
It pops up the warning.Just installed nightly, opened a project in Code, added your example, and still triggered bug. Step(s) I need to take to use system version of LSP?
Cloned git repo and ran sudo ./install --version nightly
. It added a binary at /usr/local/bin/clojure-lsp
Ah. So, Calva does not use the system clojure-lsp. It has its own binary. If you are not on an M1/M2 Mac you should be able to tell Calva to use nightly. In VS Code settings search for clojure-lsp.
There you can actually set clojure-lsp path to your system one. Depends on how you like to roll. 😃
• Added absolute path in settings, reopened window, still error.
• Deleted abs path and changed "latest" to "nightly", reopened window, still error.
• Closed all windows (in case of unexpected sharing), opened window (with "nightly" still set), still error.
• Added abs path again. Tried to delete "nightly", but it autofills with last value if field blank. (With any other windows already closed) reopened window, still error.
LSP server info at final test showing:
• clojure-lsp path configured: /usr/local/bin/clojure-lsp
• clojure-lsp version used: 2022.09.15-21.09.33-nightly
Thanks! I haven't actually tried myself, but @U9A1RLFNV did. ... Maybe we should compare repros...
FYI. There is no sharing going on. And you only need to tell Calva to restart clojure-lsp to get it to use whatever version you have configured. There are some clojure-lsp life cycle commands within easy reach from the clojure-lsp status bar button.
> Tried to delete "nightly", but it autofills with last value if field blank. Curious about this. Can you elaborate?
• Input valid value latest|nightly|1111.11.11-11.11.11
in the settings field for Clojure LSP Version.
• Click/Tap away from field.
• Delete value from field.
• Click/Tab away from the now-empty field. Empty field reverts to the valid value. (Does not apply if existing value was not valid.)
Doesn't seem like a problem in any way to me.
As shown from my trials above, an absolutely defined binary will override whatever that field says anyway. So no problem if it stays filled.
Also as indicated by the description of the path setting 😃
> When non-blank the calva.clojureLspVersion
setting will be ignored, and the binary at the path set will be used instead.
I think VS Code might behave a bit differently between our machines, because I don't get that behaviour. Anyway, the default value is latest
and you'll get that if your reset the setting:
Yeah, it was just me trying to isolate a variable, because I hadn't yet thought to use LSP Server Info command to verify what version was running. Otherwise there would be no reason for me to even try to set it to empty string.
The nightly build fixes the issue for me. I’m on MacOS (Apple Silicon). What’s your OS, @U90R0EPHA?
Repro for me is the same with either latest or nightly: • Setup:
$ mkdir lsp-bug
$ cd lsp-bug
$ echo '{:foo :bar}' > lsp-bug.clj
$ code .
In Code:
• Open lsp-bug.clj
• Run Calva Clojure LSP: Start the LSP Server
• Type into document such that {:foo :bar}
becomes {#_#:foo :bar}
.
• See error pop up: Request textDocument/codeAction failed.
@UKFSJSM38 Maybe there’s an OS-specific issue here?
Hum, I don't think so, this error is pretty specific to not considering comments which we fixed on master.
It seems it’s not fixed for @U90R0EPHA, using the nightly build.
@U90R0EPHA could get server logs and paste the exception is happening for you?
After following repro steps listed above. Here is the output of Clojure Diagnostics: Clojure-lsp Server Info
and the log file referenced there.
I can repro the issue with latest nightly, it seems to be a new issue a little bit different than what we fixed, will fix it
Just pushed a fix, could you try latest nightly? it should be available in ~10mins, you can confirm on #clojure-lsp-builds
@UKFSJSM38 It's worse. Still get same error with {#_#:foo :bar}
, but now also get error for {#:foo :bar}
.
And I now get the same error if the cursor moves to the right of the last character in the file if that char is not whitespace.
@U90R0EPHA {#_#:foo :bar}
and {#:foo :bar}
it's a invalid clojure code, it's expected that clojure-lsp can't parse the file and not provide code actions for that.
Even so, I don't get any exceptions on server log with latest nightly as server handles invalid code.
{#_#_:foo :bar}
and {#_:foo :bar}
works though.
Even if invalid code, we shouldn't get an error pop-up, right? Is this something we can prevent/not do in Calva, maybe?
What is this error popup? At least for me, there is no error popup or exception on server logs with the invalid code, we just don't send code actions which is expected
oh just saw on the original post, this should not happen anymore after the fixes we made it. That was happening because of the exceptions which should be fixed
Except the update did not fix it for me. Instead it added more scenarios that cause the exceptions.
@U90R0EPHA could you provide server logs of the exceptions with latest nightly(as of now)?
I'd like to test as well, but having troubles installing the nightly build. Not just with Calva:
curl -O
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4014 100 4014 0 0 17163 0 --:--:-- --:--:-- --:--:-- 17761
~/Projects/tests/project-in-sub-dir/lein-proj(:|✔) % chmod +x install
~/Projects/tests/project-in-sub-dir/lein-proj(:|✔) % sudo ./install --version nightly
Password:
Downloading to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.TtfYJnDp
[clojure-lsp-native-macos-aarch64.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-macos-aarch64.zip or
clojure-lsp-native-macos-aarch64.zip.zip, and cannot find clojure-lsp-native-macos-aarch64.zip.ZIP, period.
@UKFSJSM38 Looks good now. 👍
Did you push another update since my last reply. I swear I tried this yesterday (at your request) with a nightly dated on 9/18, with the results I posted above.
@U0ETXRFEW it seems a bug on https://github.com/clojure-lsp/clojure-lsp-dev-builds/releases, it's not uploading the macos-aarch64 binary, I will take a look now @U90R0EPHA yes, we merged https://github.com/clojure-lsp/clojure-lsp/pull/1251a little bit related but I can't see related to your issue exactly
> I can't see related to your issue exactly Code fairies? 🧚 I'm just gonna go with "fixed" until someone proves otherwise. 😂
I tried with the x64 nighly now and can't repro the bug. I'm going with "fixed” too. Thanks! ❤️
FYI: I noticed that after a clojure-lsp push, we create the dev tag 1min later but the binaries are uploaded only 20-30mins later (because of graal builds), if one try to install nightly during this time, it'll fail, will try to create the tag only later
It still isn't there, though? I get Not found
on
https://github.com/clojure-lsp/clojure-lsp-dev-builds/releases/download/2022.09.18-15.04.09-nightly/clojure-lsp-native-macos-aarch64.zip
Maybe I am not quite following.
but yeah @U0ETXRFEW there is some race condition issue as 2022.09.18-15.04.09-nightly didn't get the binary for mac-aarch for some reason
@U90R0EPHA can you try if Calva's nightly build works on your machine?
I found the race condition issue, it's rare, but it happens when cirrus CI build completes before github action one create the dev release tag. We use Cirrus CI just to build the macos-aarch64 binary as github actions doesn't support aarch64 yet. I'll try to make the github action trigger the Cirrus CI build instead of both being triggered from master pushes.
Yes, with that build the install script works. Still, Calva fails, but that is probably all my own fault. 😃
@U0ETXRFEW > can you try if Calva's nightly build works on your machine I was testing nightly through Calva's download while you posted this. > ...but having troubles installing the nightly build... So I had just finished downloading a moment before, while you were struggling. Have not noticed any indication of trouble downloading. As I post this, looks like I've now got 2022.09.18-15.34.34-nightly
Can you try with this VSIX, @U90R0EPHA? https://output.circle-artifacts.com/output/job/a9a0f91d-fe50-4074-b18b-a00cca9a3f9b/artifacts/0/tmp/artifacts/calva-2.0.303-1869-clojure-lsp-nightly-download-5e79724f.vsix downloading nightly is the only thing that is affected. But if you are up to it, please try with latest and some specified version too. ❤️
@U90R0EPHA I think @U0ETXRFEW wants you to just make sure the nightly download still works, as well as the download if you change the clojure-lsp version in the settings to some specific version.
https://github.com/BetterThanTomorrow/calva/wiki/Testing-VSIX-Packages#installing-a-vsix-package Here is info on installing the VSIX, in case you aren’t familiar.