Fork me on GitHub
#calva
<
2023-03-31
>
Jakub Holý (HolyJak)08:03:17

Hello folks! How do I troubleshoot > [Error - 10:34:30] Clojure Language Client client: couldn’t create connection to server. > Launching server using command /Users/me/.vscode/extensions/betterthantomorrow.calva-2.0.343/clojure-lsp failed. Error: spawn /Users/me/.vscode/extensions/betterthantomorrow.calva-2.0.343/clojure-lsp ENOENT ?

skylize17:03:00

Open the Command Palette (`Ctrl+Shift+P` / ⌘+Shift+P) and type lsp, and you should find among the commands listed just about everything that would help as far as debug logging. That looks like the LSP binary is missing, or your permissions are broken on the binary. So I'm not sure how much info would actually show up in any of the logging. First thing I would do is double-check that calva.clojureLspVersion is either unset or set to latest, nightly, or a correct valid version number. Then restart code or run Developer: Reload Window to download it again.

skylize17:03:07

And verify a good network connection before ^. Could be Calva wiped the good version, tried to download new one, and failed, leaving you no binary to run.

Jakub Holý (HolyJak)20:03:51

Thank you! USe the palette is a good idea. clojure-lsp works just fine in other projects so it is this (huge) one that has issues…

skylize21:03:07

You didn't say how the above suggestion worked, so I guessing that did not solve it? 😔 "Other projects" could actually come into play regarding the interrupted-download theory: Another window may have been actively overwriting the binary file at the same time your current project tried to start it up. In that case simply running Restart LSP Server (or something like that) from the Command Palette (once the other project has finished the download) should have you off and running.

Jakub Holý (HolyJak)15:04:09

I have tried again and now LSP worked fine (though it took quite a while to start). I see now that I can access its diagnostic log through the command palette, so I will use that the next time. Thanks!

2
Kari Marttila09:03:54

When I evaluate a form in Calva, and Calva echoes the result in VSCode, is it possible to add that result as comment at the end of the line with some hotkey? Example. I have a row:

(last time-stamps)
I evaluate it and I get the result echoed as in the picture below. How can I have the result appended at the end of this line, so that I then have a line like:
(last time-stamps) ; => "2023-03-20T07:59:21.133247" 
(i.e., I'd like to have the string ; => "2023-03-20T07:59:21.133247" appended at the end of the line with some hotkey.)

pez09:03:54

You can append the comment to a new line (or new line_s_) below the evaluated form.

Kari Marttila09:03:46

Stupid me. I should have searched that myself in VSCode keyboard shortcuts. 🙂

pez09:03:14

Haha. I’m glad you didn’t. Now more people discovered this feature.

👍 4
2
Kari Marttila09:03:39

I moved from Metosin to a big corporation. I use VSCode / Calva to analyse some AWS SageMaker results. Clojure REPL and Calva is really great for this. My team members were wondering how I did the analysis. Using Clojure and Calva! 🙂

metal 2
pez09:03:38

My colleague showed me the other day how he develops SQL queries using Clojure. Granted, it’s a Clojure code base, but I started to think it could be a cool demo/example project. Using some sql libraries and just get a nicer syntax for the SQL, and drive it from the editor.

👍 6
stantheman14:04:44

And I guess you have common short-cuts which I think I got from Sean Corfield. In which case:- Ctl-Alt-C C ;; evals form to comment next line up-arrow Ctl-J join comment to end of form

pez14:04:45

ctrl+j should be enough, right? Depends from where you evaluate the form, I guess.

stantheman14:04:46

Yep right @U0ETXRFEW I was thinking about when I added => to the comment ;; and then had to go up and Join lines....

pez14:04:24

You can always use #C03DPCLCV9N to give yourself a command that adds it as a comment on the same line, prepended with a =>.

Drew Verlee14:03:44

How does calva use cljfmt? Is it calling lein?

pez14:03:01

Warning, quite horrible code. It is among the first Clojure I ever wrote.

Drew Verlee14:03:32

No worries. Thanks for the info.

🙏 2