This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-02
Channels
- # asami (24)
- # babashka (85)
- # beginners (137)
- # calva (46)
- # cider (16)
- # clj-kondo (19)
- # cljs-dev (7)
- # clojure (13)
- # clojure-australia (1)
- # clojure-europe (10)
- # clojure-nl (4)
- # clojure-spec (6)
- # clojure-uk (3)
- # clojurescript (5)
- # conjure (21)
- # cursive (15)
- # datascript (46)
- # datomic (13)
- # depstar (32)
- # figwheel-main (1)
- # fulcro (6)
- # honeysql (20)
- # lsp (53)
- # malli (7)
- # meander (9)
- # off-topic (35)
- # other-languages (1)
- # polylith (41)
- # re-frame (5)
- # reagent (4)
- # releases (3)
- # rewrite-clj (2)
- # shadow-cljs (22)
- # spacemacs (15)
- # tools-deps (3)
- # xtdb (17)
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.
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
One thing I notice though @U9A1RLFNV is that calva is suggesting the resolve macro as even if does not has support yet
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.
Sometimes the lightbulb also obscures the actual text, although that's probably a VSCode issue rather than Calva's
You can disable the lightbulb, @UCPS050BV. That’s what I do. The quick fix action is available anyway (`cmd+.` on mac).
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/1060
• https://github.com/BetterThanTomorrow/calva/issues/1088 and bump to `2021.03.30-20.42.34`
• https://github.com/BetterThanTomorrow/calva/issues/1091
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.
Yeah, needs a folder. That’s where the Standalone REPL comes in. Glad you got it working!
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:
It could be broken… Have seen a bit of trouble with it. Yesterday there was someone, (@U6JS7B99S?) 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.
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
I’m also using datomic dev-local like the user in this issue, so that might have been part of it? Not sure.
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 🙂
Glad it is working! If you see how the http://calva.io documentation could be improved, please file an issue and/or PR.
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).i.e., the warnings are in {a 1 b 2}
not on the keys part — what does this warning even mean? “unused default”
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)))
@seancorfield unused default means that that code doesn't have any meaning because the binding for which you introduced the default was never used
instead of "unused binding" it says that, because you're not really introducing a new binding there
@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
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?
@seancorfield you can also try enabling the clj-kondo standalone vscode plugin and disable calva linting, to see if that makes a difference
@seancorfield see #lsp, it seems something specific with this
Joined. Thanks.
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
@seancorfield Tomorrow when @ericdallo creates a new lsp version you can upgrade it here:
Oh wow, good to know! Thank you!