Fork me on GitHub

Hi all, I’m currently having a hard time getting used to alt+right arrow not doing what I expect (on mac)


there is a spot in the docs that gives alternative binds, which is sweet


but i’m not sure where to put those..


Question: what would be the recommended way to use calva, with vscode or vscode-insiders?


I am used to using Emacs with Evil, so use VSpaceCode as an extension to the normal VS Code install. This works very well. I added specific mnemonic key bindings for Calva commands


I've never used modal editing, so not for me


Sometimes I regret it, because it seems that it's ported everywhere


As for insiders or not, I recommend not. Insiders contains experimental stuff. That said, I often use Insiders myself and it is pretty safe. My reasons is that I need early warnings if something in Calva would stop working in coming VS Code releases. From that perspective I would like if some brave Calva users also used Insiders.


(this is my yearly attempt-to-switch-away-from-emacs, a long tradition at this point)


@cschep You can get at the keymap via the command palette (cmd-shift-p on Mac I believe, and then type key and you should see the appropriate option listed -- I'm not at my Mac right now so that's the best guidance I can give).


Based on my it's a file called keybindings.json


@dromar56 I use the regular VS Code downloaded from the official site. It gets updates regularly, and Calva works great with it.


awesome, thanks!


I switched from Emacs to Atom and then to VS Code so I feel ya there 🙂


I see you changed this too!

      "key": "alt+right",
      "command": "cursorWordRight"


Yeah, I wanted a set of key bindings that worked on both Mac and Windows.


i’m really used to that keybinding for general text editing so it’s jarring for it to do anything else


I am on a Mac during the work day and a Windows Surface Laptop 3 at other times -- and VS Code syncs my entire setup between the two machines.


did you set that in a GUI and it spit out a json file or do you hand edit json for configuring vs code?


that’s cool how does vs code sync your stuff, is there an account you sign into?


Hand-edited the JSON file -- via whatever option came up on the palette.


I tried originally sync'ing settings via a Microsoft account but that was a bit flaky so I switched to using a GitHub account which is VS Code's other option. I believe it's marked as an experimental feature but it works really well.


Hang on, I'll fire it up on my Windows laptop...


Preferences: Open Keyboard Shortcuts (JSON) is how I edit the key bindings.


And Settings Sync: Configure is at least part of how to setup the sync. Can't remember where I found the flag to enable that.


oh github, that’s awesome


i’ll check that out, thanks!


I am used to using Emacs with Evil, so use VSpaceCode as an extension to the normal VS Code install. This works very well. I added specific mnemonic key bindings for Calva commands


Calva version 2.0.181 is out, which includes the latest clojure-lsp. calva clojure-lsp Let us know if you come across any issues. @ericdallo I like the dimming of unused symbols :thumbsup:

🚀 6
clojure-lsp 6

Yeah, I knew that that looks great in vscode indeed 🙂

🎉 3

Maybe skip the squiggle? It is a bit of a tautology 😃


Yeah, it does seem a bit redundant


hum, not sure this is possible following the LSP spec


FWIW, I get no squiggles in TypeScript:


But is this using the typescript LSP or it's using the default vscode ts support?


for this to work with LSP I think the client would need to handle that 😕


as is the spec as of now


I have no idea what is used. 😃


Probably it's the vscode default support 🙂


TBH, I get a bit worried when LSP also starts to do highlighting. It risks conflicting with Calva’s own. In this case not so much (the overlap between an ignored form and an unused one is zero). But anyway. Are there more highlighting coming?


what do you mean with highlighting? there is only provided by clojure-lsp, the others are diagnostics that should only dim if unused, strike-through if deprecated


The vscode typescript language server seems to not really follow the spec, maybe not even close. I've looked at the logs between server and client and it was a pretty different format from what I remember. It may have come before the protocol.


I know there is 2 or 3 ts lsp servers, but there is a embedded one in vscode that have its own protocol

👍 3

its own non-LSP protocol?


yeah, like dart, before using LSP, dart had its own server that ran when starting coding in a dart project, the dart_analyzer


I know vscode does something similar for js/ts as its built using js/ts


I still have the highlighting problem with cond-> forms.What gives?


Do you have a repro? I can't repro with cond->


But actually, just this top level in a file is enough:

(cond-> {:foo :bar})


I just want to call attention to in case anyone has some useful information on it. I've been working to add more ClojureScript to Calva, and in doing so I came across this issue. It limits us in using ClojureScript more widely in Calva, I think even when used for just pure code. I haven't figured out a cause, and different arrangements of the code seem to cause the issue in different places, where maybe there was no issue before, so it's really strange. There's more info in the issue. I decided to leave it alone for a while so I can focus on other work (in TypeScript) that needs to be done, and maybe someone else could provide some insight, or some clue will come to me in time.

Jakub Holý (HolyJak)20:03:05

Hello, good folks! How do I display the docstring for the function at cursor/mouse? Sometimes it just pops up but sometimes it doesn't (perhaps when there are linting issue). And "Calva doc" in the Command Palette only finds the Calva homepage... 🙏


If you mean the hover info, you can run the Show Hover command. It's mapped to ctrl+k, ctrl+i by default for me.

❤️ 3

@holyjak, I have not seen that behaviour. Linting issues should not disable the documentation hovers. How are you starting the project? Also, what do you expect from the “Calva docs” command? I’m reading in that you think it might pop up the documentation hovers? It is intended to highlight the presence of the documentation of Calva, but maybe it is confusing… Anyway I think the command for popping up the documentation hover you are looking for is the VS Code command Show Hover, on mac bound to cmd+k cmd+i. But if mouse hover doesn’t do it, the command won’t do it either.

Jakub Holý (HolyJak)20:03:14

Thank you! It indeed works as you describe for an ordinary clj project repl. The problem I have seems to be limited to externally started #babashka nrepl (and Connect to running REPL, not in project - Generic). And indeed Show Hover does not help there. (When the hover did not work, I tried to find and invoke the command manually and I expected it to include Calva and doc[string] in its name. I did not realize it was a built-in command.)


Not sure why it wouldn’t work with babashka. You don’t have cider-mrepl there, but lsp should be working. Maybe lsp needs some help that it doesn’t get in your file… @ericdallo might now.


clojure-lsp doesn't support babashka deps ATM, the issue is that bb doesn't have a deps.edn or a file with its deps so there is no way to clojure-lsp know the classpath to analyze that. @U04V15CAJ created this issue


Ah, that figures.


For now you can add a deps.edn with the deps you want analysis for

☝️ 3
metal 3
👍 3