Fork me on GitHub

Bring some emoji-love to this one in the #announcements channel, Calva-friends.

woohoo 18

@U0ETXRFEW I reset the LSP version, and Calva complains (after the restart) that the field isn't set and LSP will not be started.


Ah, this seems to be on WSL2 only, with the Remote install.


Strange WSL2 specific behaviour... How did you reset this? (Editing settings.json or other method.)


I just blanked out the field in the setting pane. It works fine on macOS as far as I can tell.


Can you check if there is an entry in settings.json for this still? (There are VS Code commands for opening the relevant JSON file.)


Well, I just set the field again and reloaded to get it working 🙂


And it's downloading LSP at the moment (I'm on mobile data, waiting for my wife at the hospital)


I can try it myself from your description. Hoping things are not too awful for your wife?


Just a CT scan. Possible cyst on her pancreas.


Here's the message from Calva: The calva.clojureLspVersion setting is blank and calva.clojureLspPath is also blank, so clojure-lsp will not be started. Please reset the calva.clojureLspVersion setting to use the default version of clojure-lsp, or set it to a clojure-lsp version you want to use. Alternatively, you can set the calva.clojureLspPath to use a downloaded binary of clojure-lsp.


(it downloaded & started LSP -- now I blanked out the field and reloaded to repro)


The JSON has

"calva.clojureLspVersion": "",


Yes, so that should behave like the message says. I would say the WSL2 issue you had is the correct one. 😃


Yup. If I delete that line from the JSON and reload, it finds LSP and starts it just fine.


I don’t remember why we don’t support a blank setting, but anyway, reset it in the settings panel, using the cog-wheel icon menu, or remove the entry from settings.json.


You beat me to it. 😃


So blanking out the field should work, but doesn't?


Not really. There are two complected settings for lsp. Either you set the clojureLspPath (providing an executable at the path) or the clojureLspVersion (telling Calva to download that version). I think the path overrides the version. (And I still don’t remember why a blank version setting isn’t working.)


It's working now, so thank you 🙂


And thank you. I think I need to fix the blank version setting case and/or clarify what “reset” means in the documentation and description.


I added that message in the past after realizing an issue with it being blank. Here's a comment from the code:

// This should never be an empty string and can cause issues with clojure-lsp starting, particularly if there is no version file yet from a previous download and no custom clojure-lsp path set. Inform the user.
At the time, we weren't defaulting to latest. When the version setting is blank, I may have thought/assumed there was no way to get the default setting (it's set in package.json), though I'm not sure why I thought so. Also at that time we weren't defaulting to the latest version like we are now, so when the setting was blank, assuming we couldn't get the default value (maybe we actually can), we had no way to know which version to run.


I probably goofed there, but at least added a message informing of the situation. 😄


Now, we can probably set the version to 'latest' if it's blank.


That makes sense. At least one user assumed this behaviour. 😃


If I'd already read the text over the setting field, I would have seen that latest is a valid setting... but I just followed "reset the setting..." in the release announcement 🙂


We instruct to reset in the docs as well. (Since if a user wants to go with the defaults it is better to reset them than to set them to whatever is the current default.)


Fixed it so that blank is interpreted as latest in this PR.

👍 3

Anyone using VSpaceCode? I'm trying it out with Calva, just to see how the other side lives and I'm going through the hello_repl docs 🌟. I've got two questions (already):

(->> colt-express
1. In normal-mode I can't put my cursor past s in :ratings so I can't eg. run the Ctrl+Alt+Enter to just eval up to that point (I would need to put my cursor on the whitespace before vals. 2. I can't seem to find any major-mode keybindings for this operation to eval "up to some step" in the threading macro. e.g. I can use the keybinding , e f to eval top-form or , e e to eval current form, but nothing for this operation. Is there some extended keybindings I'm not aware of? I apologize in advance for my #noob questions, but I'm new to both VSCode and Calva. Also, let me know if this is not the right channel for VSpaceCode questions.


OK, it seems I can mainly just replace it with Shift+Alt+Enter on the next line and it will Work As Expected. I don't think there would be many times where I would not want to eval from top-level-form


These evaluation commands are pretty new, so maybe they predate the VSpaceCode configuration. Could that be it, @U05254DQM?


I was looking for the equivalent of emacs describe-key to find out what this shortcut was doing, but I ended up just digging into the source:


I just used the command pallet to find the command names. 1) this is how Evil is supposed to work in my opinion, nothing to change here 2) The PR you found on VSpacemacs shows you how to add keybindings I dont use Calva myself, unless I am going to do a VSCode Live coding session, so it would be quicker to add your own that wait for me:)


I use #_ reader macro comments if I want to see only part of a threading macro. I have a keybinding in Emacs to comment sections of the thread this way, perhaps something can be to Calva for this (I have no idea how)


@U05476190, the source works well for this. There is also the Keyboard Shortcuts panel cmd/ctrl+k cmd/ctrl+s. There you can search for commands by shortcut or by name.


@U05254DQM RE: 1, this is how it works in ViM, but in Emacs Evil mode, I can put the cursor after the last char in the line (even though there is no actual whitespace character written to the file); which is super useful for all the kinds of commands that are based on "eval the last form/thing/etc". I wonder if this is some kind of option I can change in vscode.vim


Thanks for the following up @U05254DQM and @U0ETXRFEW; I'll be sure to try to use Calva more over the next couple of days


It’s tricky for Calva to solve this. The Vim extension does not have an API. So there is no way for Calva to know that Vim normal mode is active.


1. thats not normal evil mode behaviour as I see it. some people like to change the behaviour of evil and are free to do so, but its not for me. I use use the next line, as lines are irrelevant to those commands. I only use eval-last s-expression commands to evaluate nested expressions


Thanks for the gist, I will diff the two :)


That PR was the most JSON I have ever written in one weekend, not the most enjoyable weekend I've had. But happy it works and others find it useful