Fork me on GitHub
#calva
<
2021-03-22
>
cschep03:03:54

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

cschep03:03:05

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

cschep03:03:11

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

solf04:03:04

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

practicalli-johnny09:03:54

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

solf09:03:20

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

solf09:03:28

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

pez10:03:31

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.

solf04:03:26

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

seancorfield04:03:31

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

seancorfield04:03:06

Based on my https://github.com/seancorfield/vscode-clover-setup it's a file called keybindings.json

seancorfield04:03:50

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

cschep04:03:02

awesome, thanks!

seancorfield04:03:12

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

cschep04:03:32

I see you changed this too!

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

seancorfield04:03:00

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

cschep04:03:31

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

seancorfield04:03:36

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.

cschep04:03:10

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

cschep04:03:34

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

seancorfield04:03:46

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

seancorfield04:03:37

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.

seancorfield04:03:38

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

seancorfield04:03:29

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

seancorfield04:03:07

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.

cschep04:03:31

oh github, that’s awesome

cschep04:03:37

i’ll check that out, thanks!

practicalli-johnny09:03:54

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

bringe16:03:47

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
ericdallo17:03:33

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

🎉 3
pez17:03:07

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

bringe17:03:53

Yeah, it does seem a bit redundant

ericdallo17:03:19

hum, not sure this is possible following the LSP spec

pez17:03:34

FWIW, I get no squiggles in TypeScript:

ericdallo17:03:01

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

ericdallo17:03:27

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

ericdallo17:03:38

as is the spec as of now

pez17:03:22

I have no idea what is used. 😃

ericdallo17:03:19

Probably it's the vscode default support 🙂

pez17:03:59

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?

ericdallo17:03:25

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

bringe17:03:35

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.

ericdallo17:03:21

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

👍 3
ghadi18:03:27

its own non-LSP protocol?

ericdallo18:03:22

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

ericdallo18:03:28

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

pez22:03:50

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

ericdallo22:03:36

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

pez10:03:04

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

(cond-> {:foo :bar})

bringe17:03:29

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.

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

bringe20:03:18

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
pez20:03:44

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

pez21:03:36

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.

ericdallo21:03:22

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

pez21:03:33

Ah, that figures.

borkdude21:03:28

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

☝️ 3
metal 3
👍 3