calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
cschep 2021-03-22T03:57:54.053900Z

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

cschep 2021-03-22T03:58:05.054200Z

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

cschep 2021-03-22T03:58:11.054600Z

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

solf 2021-03-22T04:21:04.055100Z

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

solf 2021-03-22T09:50:20.069200Z

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

solf 2021-03-22T09:50:28.069400Z

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

pez 2021-03-22T10:27:31.069600Z

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.

solf 2021-03-22T04:21:26.055400Z

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

seancorfield 2021-03-22T04:27:31.057100Z

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

seancorfield 2021-03-22T04:28:06.057500Z

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

seancorfield 2021-03-22T04:28:50.058400Z

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

cschep 2021-03-22T04:29:02.058800Z

awesome, thanks!

seancorfield 2021-03-22T04:29:12.059100Z

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

cschep 2021-03-22T04:29:32.059500Z

I see you changed this too!

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

seancorfield 2021-03-22T04:30:00.059900Z

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

cschep 2021-03-22T04:30:05.060300Z

ah nice

cschep 2021-03-22T04:30:31.061200Z

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

seancorfield 2021-03-22T04:30:36.061500Z

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.

cschep 2021-03-22T04:31:10.061900Z

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

cschep 2021-03-22T04:31:34.062300Z

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

seancorfield 2021-03-22T04:31:46.062700Z

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

seancorfield 2021-03-22T04:32:37.063700Z

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.

seancorfield 2021-03-22T04:33:38.064Z

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

seancorfield 2021-03-22T04:34:29.064500Z

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

seancorfield 2021-03-22T04:36:07.065300Z

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.

cschep 2021-03-22T04:41:31.065500Z

oh github, that’s awesome

cschep 2021-03-22T04:41:37.065700Z

i’ll check that out, thanks!

bringe 2021-03-22T16:55:47.071200Z

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:

2
🚀 2
pez 2021-03-23T22:07:50.089Z

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

ericdallo 2021-03-23T22:59:36.096Z

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

pez 2021-03-24T10:55:04.103200Z

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

(cond-> {:foo :bar})

ericdallo 2021-03-22T17:02:33.072200Z

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

🎉 1
bringe 2021-03-22T17:08:29.072600Z

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.

pez 2021-03-22T17:14:07.073200Z

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

bringe 2021-03-22T17:14:53.073400Z

Yeah, it does seem a bit redundant

ericdallo 2021-03-22T17:17:19.073700Z

hum, not sure this is possible following the LSP spec

pez 2021-03-22T17:28:34.073900Z

FWIW, I get no squiggles in TypeScript:

ericdallo 2021-03-22T17:32:01.074300Z

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

ericdallo 2021-03-22T17:32:27.074500Z

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

ericdallo 2021-03-22T17:32:38.074700Z

as is the spec as of now

pez 2021-03-22T17:36:22.074900Z

I have no idea what is used. 😃

ericdallo 2021-03-22T17:37:19.075100Z

Probably it's the vscode default support 🙂

pez 2021-03-22T17:39:59.075300Z

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?

ericdallo 2021-03-22T17:43:25.075500Z

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

bringe 2021-03-22T17:52:35.075900Z

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.

ericdallo 2021-03-22T17:57:21.076100Z

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

👍 1
ghadi 2021-03-22T18:29:27.076400Z

its own non-LSP protocol?

ericdallo 2021-03-22T18:30:22.076700Z

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

ericdallo 2021-03-22T18:30:28.076900Z

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

Jakub Holý 2021-03-22T20:10:05.079100Z

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

bringe 2021-03-22T20:44:18.082700Z

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.

❤️ 1
pez 2021-03-22T20:46:44.084700Z

@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ý 2021-03-22T20:59:14.084800Z

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

pez 2021-03-22T21:27:36.085100Z

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.

ericdallo 2021-03-22T21:31:22.085300Z

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. @borkdude created this issue https://github.com/babashka/babashka/issues/733

pez 2021-03-22T21:32:33.085600Z

Ah, that figures.

borkdude 2021-03-22T21:39:28.085800Z

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

👍 1
🤘 1
☝️ 1