Fork me on GitHub
#calva
<
2022-09-16
>
pez10:09:51

Enjoy!

calva 4
Stefan T21:09:01

Is anybody else constantly getting this evaluation error while they type?

Jacob Emcken21:09:02

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).

Stefan T21:09:29

Same, seems to have started in the past couple of days for me as well

pez06:09:48

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.)

👍 1
Max14:09:50

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 (`#_`)

🙏 1
skylize15:09:02

@U0ETXRFEW Is there a particular action I can do to trigger the bug on purpose?

pez15:09:22

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.

skylize15:09:04

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?

pez15:09:42

How did you install nightly?

skylize15:09:02

Cloned git repo and ran sudo ./install --version nightly. It added a binary at /usr/local/bin/clojure-lsp

pez15:09:33

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.

pez15:09:43

There you can actually set clojure-lsp path to your system one. Depends on how you like to roll. 😃

pez15:09:12

But default is that Calva uses latest clojure-lsp. Or nightly, if you tell it that.

skylize15:09:37

• 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-lspclojure-lsp version used: 2022.09.15-21.09.33-nightly

pez15:09:09

Thanks! I haven't actually tried myself, but @U9A1RLFNV did. ... Maybe we should compare repros...

pez15:09:42

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.

pez16:09:32

> Tried to delete "nightly", but it autofills with last value if field blank. Curious about this. Can you elaborate?

skylize16:09:04

• 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.

skylize16:09:41

As shown from my trials above, an absolutely defined binary will override whatever that field says anyway. So no problem if it stays filled.

pez16:09:58

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.

pez16:09:31

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:

skylize16:09:19

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.

bringe17:09:40

The nightly build fixes the issue for me. I’m on MacOS (Apple Silicon). What’s your OS, @U90R0EPHA?

skylize17:09:24

Arch

👍 1
skylize17:09:10

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.

👍 1
bringe17:09:02

@UKFSJSM38 Maybe there’s an OS-specific issue here?

ericdallo17:09:57

Hum, I don't think so, this error is pretty specific to not considering comments which we fixed on master.

bringe18:09:54

It seems it’s not fixed for @U90R0EPHA, using the nightly build.

bringe18:09:41

It looks like they took the right steps to ensure Calva was using nightly.

ericdallo18:09:36

@U90R0EPHA could get server logs and paste the exception is happening for you?

skylize19:09:50

After following repro steps listed above. Here is the output of Clojure Diagnostics: Clojure-lsp Server Info and the log file referenced there.

ericdallo21:09:39

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

ericdallo21:09:28

Just pushed a fix, could you try latest nightly? it should be available in ~10mins, you can confirm on #clojure-lsp-builds

skylize00:09:59

@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.

👀 1
ericdallo15:09:42

@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.

pez15:09:30

Even if invalid code, we shouldn't get an error pop-up, right? Is this something we can prevent/not do in Calva, maybe?

ericdallo15:09:42

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

ericdallo15:09:09

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

skylize15:09:26

Except the update did not fix it for me. Instead it added more scenarios that cause the exceptions.

ericdallo15:09:27

@U90R0EPHA could you provide server logs of the exceptions with latest nightly(as of now)?

ericdallo15:09:42

This is a gif on my side showing no errors no matter the code is valid or not

pez15:09:18

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.

1
pez15:09:53

I get the same unzip error when downloading the zip like so:

curl -O 

skylize15:09:59

@UKFSJSM38 Looks good now. 👍

skylize15:09:03

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.

pez15:09:49

Ah, nice! Then I can chill with the nightly install here 😃

ericdallo15:09:26

@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

skylize15:09:29

Wait no. Today is 9/18. :face_palm: So yeah. I guess you pushed a new one. 😄

skylize15:09:50

> I can't see related to your issue exactly Code fairies? 🧚 I'm just gonna go with "fixed" until someone proves otherwise. 😂

👍 1
pez15:09:42

I tried with the x64 nighly now and can't repro the bug. I'm going with "fixed” too. Thanks! ❤️ gratitude

👍 1
ericdallo15:09:25

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

ericdallo15:09:25

yep, I'm making some pushes to test it 😅

ericdallo15:09:30

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

👍 1
pez16:09:00

@U90R0EPHA can you try if Calva's nightly build works on your machine?

pez16:09:20

That is if Calva's download of clojure-lsp's nighltly build works... 😃

ericdallo16:09:26

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.

ericdallo16:09:45

even so, it's rare, latest nightly should be OK for you

pez16:09:36

Yes, with that build the install script works. Still, Calva fails, but that is probably all my own fault. 😃

😅 1
skylize16:09:20

@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

pez16:09:47

Using Calva's nightly download?

pez16:09:42

Cool. Let's hope it keeps working once I have fixed it for M1. 😃

pez17:09:50

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. ❤️

skylize17:09:29

Also not clear to me what you want me to test or how

bringe17:09:24

@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.

🙏 1
skylize23:09:29

@U0ETXRFEW All downloads working fine for me.

🎉 2
🙏 1