This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-14
Channels
- # announcements (2)
- # babashka (7)
- # beginners (20)
- # calva (2)
- # clj-kondo (7)
- # clojure (31)
- # clojure-australia (3)
- # clojure-dev (10)
- # clojure-europe (7)
- # clojurescript (13)
- # conjure (1)
- # cursive (27)
- # datomic (168)
- # events (3)
- # fulcro (2)
- # garden (3)
- # honeysql (2)
- # jobs (1)
- # joker (1)
- # lsp (52)
- # releases (1)
- # shadow-cljs (11)
- # slack-help (4)
- # spacemacs (22)
- # sql (1)
followup question from yesterday: I have a checkout of clojure-lsp
, and I invoke lsp
in emacs
with:
(after! clojure-mode (setq lsp-clojure-custom-server-command '("bash" "-c" "cd /home/carlo/code/clojure/clojure-lsp && lein run")))
Then, I get the port via lsp-clojure-server-info
, and cider-connect
to localhost
and that port. However, in the repl, I get this warning:
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
In the documentation for cider
, I learnt that cider
injects automatically the middleware in the case of cider-jack-in
, but not in the case of cider-connect
. So I modified clojure-lsp/deps.edn
to have this section:
:aliases {:test {:extra-paths ["test"]}
:debug {:extra-deps {nrepl/nrepl {:mvn/version "0.8.3"}
cider/cider-nrepl {:mvn/version "0.25.9"}}}
:run {:main-opts ["-m" "clojure-lsp.main"]
:jvm-opts ["-Xmx2g" "-server"]}}
(note the cider-nrepl
addition). However, nothing changed. I suspect that is because I'm not really using the debug version, so I'm trying setting the command to:
lein with-profile :debug run ;; doesn't work
or other variations, but can't get cider-nrepl
to work properly. Ideas, @ericdallo?ok, now I have as my ~/.lein/profiles.clj
:
{:user {:dependencies [[org.clojure/tools.namespace "0.2.3"]
[spyscope "0.1.3"]
[criterium "0.4.1"]
[cider/cider-nrepl "0.25.9"]
[nrepl/nrepl "0.8.3"]]}}
and the command is still
(after! clojure-mode (setq lsp-clojure-custom-server-command '("bash" "-c" "cd /home/carlo/code/clojure/clojure-lsp && lein run")))
but I still have:
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
is that because I need to inject them myself somehow?Hum, I have no idea, never faced this warning. Maybe https://github.com/clojure-emacs/cider-nrepl/issues/597 can help?
no, that's where I learned the difference in behavior between cider-connect
and cider-jack-in
. I'm starting to thing that maybe what I want to accomplish might be impossible in the current tooling
Yeah, I never tried cider debug, and only used debug from DAP on other languages, and honestly the cider + clojure-lsp works pretty well to me to hack and code
I understand that it might seem strange that I insist in trying to get this workflow right, but it would be my dream workflow for a project like this, and I'm dabbling in clojure to see how well I can optimize for happiness 😂
Jack into a project that uses clojure cli and copy the jack in command printed at the top of the repl and modify it as you need
Hi. I noticied that sometimes I lose the arities of the the functions in the minibuffer, I think lsp errors override the minibuffer. Here's an example:
For example, the first paren is underlined because I'm redifining the function and I get the warning when I move the point to that paren.
which editor is this? I found that VSCode did this too, so in the clj-kondo lsp server I worked around it like this: https://github.com/clj-kondo/clj-kondo.lsp/blob/90714f7d9a867110b003c24008c46ae4956c65c7/server/src/clj_kondo/lsp_server/impl/server.clj#L72
https://github.com/borkdude/flycheck-clj-kondo this one, right?
yes. you can turn off linting with the lsp plugin, that's how I do it locally. you will need to install the clj-kondo binary though
btw, to turn it off I added this to my ~/.lsp/config.edn file, is that enough?
:linters {:clj-kondo {:level :off}}
@UJCC6CE9E You can do this on the client side
I think it's best to do it there. clojure-lsp still uses clj-kondo for analysis and it will also use information from findings
The minibuffer blinking between the arity and the linting error was driving me crazy 😛 and I like the arity message
Could you elaborate? we have a pretty similar function in clojure-lsp: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/diagnostics.clj#L10
My function is to avoid underlining the entire s-expression in case it's an expression with parens
looks a good fix for now, I'll try to make that happen for clojure-lsp as well, thanks for the tip @U04V15CAJ
yeah, not sure if kondo should do this by itself, the end locations may be used by some tools for other purposes
Fixed on latest release @UJCC6CE9E 😄
Thanks @ericdallo! I'll try it after having dinner