This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-26
Channels
- # babashka (7)
- # beginners (85)
- # calva (39)
- # cider (3)
- # clara (1)
- # clj-kondo (10)
- # clojure (194)
- # clojure-europe (36)
- # clojure-madison (2)
- # clojure-nl (13)
- # clojure-spec (11)
- # clojure-uk (2)
- # clojurescript (17)
- # community-development (5)
- # component (9)
- # conjure (4)
- # core-async (3)
- # cursive (32)
- # data-science (26)
- # datomic (31)
- # graalvm (22)
- # holy-lambda (31)
- # honeysql (7)
- # introduce-yourself (1)
- # jobs (9)
- # jobs-rus (1)
- # lsp (3)
- # malli (9)
- # off-topic (54)
- # pathom (27)
- # pedestal (6)
- # portal (1)
- # re-frame (4)
- # releases (1)
- # remote-jobs (1)
- # sci (3)
- # shadow-cljs (4)
- # spacemacs (13)
- # vim (14)
- # xtdb (3)
On guix os calva is not able to start static code analysis. I believe it is because guix does not have programs in /bin but rather in a uncommon location /gnu/store. Any ideas could fix that? Or at least see debug logs that show me the underlying issue. Thanks!
Hi! By default Calva downloads the clojure-lsp executable and runs it, so it is not looking for in some conventional directory. What error message do you get?
Guix works similar to NixOS, I'm a nix user and as PEZ said, Calva should download the static linux binary for you which should work for Guix.
@U0ETXRFEW do you know if calva downloads the Linux binary or the static linux binary? For Guix/NixOS and probably other Isso only the static one will work
Don't know, maybe @U9A1RLFNV knows. He's on Linux.
Yep, it's not downloading the static one, I think it's a easy fix, just switch the linux to use the static one: https://github.com/BetterThanTomorrow/calva/blob/published/src/lsp/download.ts#L24
@U0ETXRFEW I’ve been on MacOS for some time now. Switched partly for work (iOS RN dev). @UKFSJSM38 The static one would work for all linux distros or just for the static distros?
@hoertlehner A workaround, until we fix that, is to download the static binary from the clojure-lsp releases and and set the path to it in your settings for Calva. https://calva.io/clojure-lsp/#using-a-custom-clojure-lsp-native-binary
Once we update the code you might want to reset that setting so Calva goes back to downloading the latest version for your OS.
Thanks to everyone! I was successful with downloading clojure native static version and setting the calva clojure-lsp setting to: /home/florian/repo/clojure-quant/clojure-lsp
@hoertlehner I’ve made Calva download the static Linux binary for clojure-lsp if the host OS is Linux. If you could install this vsix and let me know if clojure-lsp downloads and starts successfully for you, that would be helpful. https://output.circle-artifacts.com/output/job/6c859cfc-da8b-437e-bb3b-f77835b5a783/artifacts/0/tmp/artifacts/calva-2.0.270-fix-downloaded-clojure-lsp-static-linux-e6c39d5c.vsix If anyone else who uses a non-static Linux distro could try this as well that would be great.
Hi! Is there a way to evaluate the current file with calva without going form by form?
Hello! There is a command Calva: Load Current Files and Dependencies. See also: https://calva.io/commands-top10/
Hi! Are you aware of a way to wrap a fn in such a way that Calva's tooltips will show the original fn's docstring?
A bit more context in https://clojurians.slack.com/archives/C03S1KBA2/p1651005125829969.
Maybe it works with something like this?
(def ^{:doc (:doc (meta #'original-fn))} my-fn original-fn)
(Haven't tested. 😃 )Yes, it does work (I tried many things like this last year without success), thanks a lot, I'll continue experimenting to make sure it works well with multiple arglists, etc!
Yeah, I'd need to copy not just the :doc
obviously. 🙂
I've had success manually:
Yeah, maybe because it is late here, but I had forgotten the args-list is there. Very cool. Neat with the prefix!
Getting subjectively late for me too! 🙂 It's with a macro wrapper that I'm yet to succeed, now.
This is Cascadia Code from Microsoft.
Finally came back to this. Thanks a lot Peter!
An intern-based solution suggested by Sean Corfield in the other thread worked.
Observe the (defn wrap-fn
solution works but Clj-Kondo underlines in red the produced var, obviously.
Then, a lightweight (defmacro defwrapped
wraps the call to make it understandable by clj-kondo.
In this example, note it only allows to prefix and suffix docstrings.
This current implementation allows us to give a new name to the wrapped function. Not sure if it's really a good idea. The most important next step is to weed out how to override the original fn's body/bodies.
Here's Calva happy
Wow! My last blog post is from 2009. Gotta think about it!
Maybe a post on Clojureverse would be a sufficiently linkable artifact?
Nothing yet exposed to the wrapper body, but some docstring-handling progress
@hoertlehner I’ve made Calva download the static Linux binary for clojure-lsp if the host OS is Linux. If you could install this vsix and let me know if clojure-lsp downloads and starts successfully for you, that would be helpful. https://output.circle-artifacts.com/output/job/6c859cfc-da8b-437e-bb3b-f77835b5a783/artifacts/0/tmp/artifacts/calva-2.0.270-fix-downloaded-clojure-lsp-static-linux-e6c39d5c.vsix If anyone else who uses a non-static Linux distro could try this as well that would be great.