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`.
yuhan 2021-04-02T02:10:14.250900Z

I just looked at Calva for the first time in a while, it's amazing how many improvements were made in the meantime! One somewhat distracting "new" behaviour I noticed though - the "quick fixes" lightbulb is being triggered for basically everywhere, suggesting that I change collections to vectors/maps or cycle the privacy of defs. Where is this coming from and can I disable it on a per-rule basis? Some refactorings like "move to let" are useful but others just create unnecessary noise and clutter on a default config.

pez 2021-04-02T07:17:47.252300Z

You can disable the lightbulb, @qythium. That’s what I do. The quick fix action is available anyway (`cmd+.` on mac).

👍 1
☝️ 1
bringe 2021-04-02T20:37:22.270Z

Thanks for the heads up @ericdallo

👍 1
ericdallo 2021-04-02T02:53:42.251Z

Those are code actions that come from clojure-lsp, they are suggestions and there is no opt-out ATM. it's pretty common to return all available code actions and user decide if use or not, if you want important code actions only, VSCode will show a different color for the ones clojure-lsp qualify as important for that code like add missing require

ericdallo 2021-04-02T02:54:12.251200Z

One thing I notice though @brandon.ringe is that calva is suggesting the resolve macro as even if does not has support yet

ericdallo 2021-04-02T02:54:29.251400Z

You may want to ignore that action or implement it maybe

yuhan 2021-04-02T04:03:52.251600Z

I see, thanks for the info! I just found it a minor annoyance more than anything, like a notification counter that won't go away.

yuhan 2021-04-02T04:04:43.251800Z

Sometimes the lightbulb also obscures the actual text, although that's probably a VSCode issue rather than Calva's

pez 2021-04-02T08:25:26.253300Z

New Calva version, v2.0.184 just released, with these changes: • Fix: https://github.com/BetterThanTomorrow/calva/issues/1086 • Fix: https://github.com/BetterThanTomorrow/calva/issues/1060https://github.com/BetterThanTomorrow/calva/issues/1088 and bump to `2021.03.30-20.42.34` • https://github.com/BetterThanTomorrow/calva/issues/1091

4
4
❤️ 3
🎉 3
Luan 2021-04-02T17:20:03.257400Z

Hey guys. It seems that although the jack-in command was working for me a few days ago, VSCode now tells me Ctrl + Alt + C, Ctrl + Alt + J is "not a command". Further probing reveals that the command does not appear in the command palette when searched for. I also found this thread where @pez dealt with the same (or a similar) thing some time ago so I thought he or another might recall the solution. https://github.com/BetterThanTomorrow/calva/issues/287 I tried installing the versions from 3 and 6 days ago to see if it had anything to do with the update, but no apparent difference. Worth making a help report, or maybe I'm missing something? Thanks – on the brighter side, loving this plug-in so far.

pez 2021-04-02T17:34:34.258200Z

Are you in a Clojure project when attempting jack-in?

Luan 2021-04-02T17:36:38.259100Z

Tried both with a Clojure project open and without one open; same result.

cjsauer 2021-04-02T17:37:27.260100Z

Is the shadow-cljs + deps.edn jack-in option known to be broken? I can’t quite get it working. No error messages, no logs, it just hangs at nREPL server started on port… and the output REPL buffer never drops into a prompt. My http server needs to be started by running (go) in the clj repl, but I can’t get that far, which means I can never load my cljs code in the browser to get that runtime connected either. :thinking_face:

Luan 2021-04-02T17:38:43.260200Z

Hang on . . . It was only the file that was open.

Luan 2021-04-02T17:38:52.260400Z

With the folder open, seems to work.

Luan 2021-04-02T17:39:12.260600Z

Thank you!

pez 2021-04-02T17:41:08.260800Z

Yeah, needs a folder. That’s where the Standalone REPL comes in. Glad you got it working!

pez 2021-04-02T17:41:37.261700Z

Good Friday, Calva-friends 😃 https://twitter.com/pappapez/status/1378039453122498561

👍 4
pez 2021-04-02T17:46:26.262Z

It could be broken… Have seen a bit of trouble with it. Yesterday there was someone, (@alpox?) who posted about a setup using a deps.edn alias instead. I will have a look at deps.edn + shaodw-cljs tomorrow to see if it is the implementation or the documentation that is broken.

cjsauer 2021-04-02T17:46:53.262200Z

I just got it working! I used the custom :watch alias in deps.edn documented in this issue here: https://github.com/BetterThanTomorrow/calva/issues/1032

cjsauer 2021-04-02T17:47:21.262600Z

I’m also using datomic dev-local like the user in this issue, so that might have been part of it? Not sure.

cjsauer 2021-04-02T17:48:08.262800Z

I also restarted VS Code and that seemed to shake something loose. There was an update at the exact same moment, so it might have just been terrible timing 🙂

cjsauer 2021-04-02T17:48:22.263Z

Anyway, thank you for Calva 🙏 , it’s a really great tool

pez 2021-04-02T17:49:05.263200Z

Glad it is working! If you see how the http://calva.io documentation could be improved, please file an issue and/or PR.

👍 1
alpox 2021-04-02T18:14:48.263500Z

I did the same thing due to likely the same issue ;)

seancorfield 2021-04-02T20:17:57.265800Z

Given the following snippet of code:

(defmulti foo :bar)
(defmethod foo :test
  [{:keys [a b] :or {a 1 b 2}}]
  (let [q (* 10 (dec a))]
    (+ b q)))
I’m seeing unused default for binding a (and b) here. The warning doesn’t show up in the latest clj-kondo when run standalone. @borkdude confirmed he sees it in Calva and that it doesn’t appear in standalone clj-kondo (from the command-line).

seancorfield 2021-04-02T20:18:51.266600Z

i.e., the warnings are in {a 1 b 2} not on the keys part — what does this warning even mean? “unused default”

borkdude 2021-04-02T20:21:31.267200Z

Funnily enough the warning goes away when you change it to defn:

(defn foo
  [{:keys [a b] :or {a 1 b 2}}]
  (let [q (* 10 (dec a))]
    (+ b q)))

borkdude 2021-04-02T20:22:36.267800Z

@seancorfield unused default means that that code doesn't have any meaning because the binding for which you introduced the default was never used

borkdude 2021-04-02T20:23:03.268200Z

instead of "unused binding" it says that, because you're not really introducing a new binding there

borkdude 2021-04-02T20:25:38.269Z

@pez I think it would be useful if Calva printed the contents of CLJ_KONDO_VERSION at startup (this is available in the classpath) so people know what they are using

borkdude 2021-04-02T20:26:40.269600Z

@seancorfield you can also try enabling the clj-kondo standalone vscode plugin and disable calva linting, to see if that makes a difference

borkdude 2021-04-02T20:50:40.270800Z

@seancorfield see #lsp, it seems something specific with this

seancorfield 2021-04-02T20:57:04.271200Z

Joined. Thanks.

bringe 2021-04-02T20:57:31.271300Z

Startup of Calva itself, right? We currently have the "LSP Server Info" command which shows the kondo version being used by lsp. Do you mean this?

borkdude 2021-04-02T20:57:49.271500Z

oh I didn't know this, thanks

👍 1
borkdude 2021-04-02T21:55:23.272300Z

I heard it's possible to update clojure-lsp separately from calva, how does one do this? I don't find the info here: https://calva.io/clojure-lsp/#troubleshooting

borkdude 2021-04-02T21:56:36.272600Z

Oh, I see. In the extension settings

borkdude 2021-04-02T21:57:08.273Z

@seancorfield Tomorrow when @ericdallo creates a new lsp version you can upgrade it here:

👍 1
bringe 2021-04-02T21:59:48.273700Z

Ah we need to add that setting to the docs. Thanks

seancorfield 2021-04-02T22:03:18.273900Z

Oh wow, good to know! Thank you!

pez 2021-04-02T22:33:14.274Z

https://github.com/BetterThanTomorrow/calva/pull/1089 ¯\(ツ)

pez 2021-04-02T22:34:14.274300Z

😃