This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-22
Channels
- # announcements (1)
- # babashka (28)
- # beginners (120)
- # braveandtrue (6)
- # calva (59)
- # cider (10)
- # clj-kondo (10)
- # cljfx (2)
- # clojure (66)
- # clojure-europe (20)
- # clojure-germany (1)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-norway (1)
- # clojure-serbia (17)
- # clojure-spain (1)
- # clojure-uk (17)
- # clojurescript (120)
- # clojureverse-ops (4)
- # core-async (5)
- # cursive (18)
- # data-oriented-programming (1)
- # datomic (4)
- # deps-new (8)
- # emacs (14)
- # fulcro (16)
- # funcool (2)
- # kaocha (4)
- # lambdaisland (5)
- # luminus (1)
- # malli (47)
- # membrane (9)
- # mid-cities-meetup (2)
- # music (1)
- # off-topic (44)
- # pathom (13)
- # practicalli (2)
- # re-frame (15)
- # reagent (34)
- # reveal (25)
- # ring (56)
- # rum (1)
- # shadow-cljs (23)
- # sql (14)
- # startup-in-a-month (1)
- # tools-deps (10)
- # vim (9)
- # vscode (3)
- # xtdb (9)
Hi all, I’m currently having a hard time getting used to alt+right arrow not doing what I expect (on mac)
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 https://practicalli.github.io/clojure/clojure-editors/#vspacecode
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.
@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 https://github.com/seancorfield/vscode-clover-setup 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.
I switched from Emacs to Atom and then to VS Code so I feel ya there 🙂
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?
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.
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 https://practicalli.github.io/clojure/clojure-editors/#vspacecode
Calva version 2.0.181 is out, which includes the latest clojure-lsp. Let us know if you come across any issues. @ericdallo I like the dimming of unused symbols :thumbsup:
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 https://clojure-lsp.github.io/clojure-lsp/features/#document-highlight-on-hover-showing-symbol-usages 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
yeah, like dart, before using LSP, dart had its own server that ran when starting coding in a dart project, the dart_analyzer
Here it happens: https://github.com/PEZ/rn-rf-shadow/blob/c00f1d4d882c83758409a22490d5df3f6ac29efb/src/main/example/app.cljs#L15
I just want to call attention to https://github.com/BetterThanTomorrow/calva/issues/1074 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.
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.
@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.
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 https://github.com/babashka/babashka/issues/733