This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-10
Channels
- # announcements (3)
- # babashka (16)
- # beginners (41)
- # biff (4)
- # calva (14)
- # circleci (1)
- # clj-http (24)
- # clj-kondo (9)
- # clj-on-windows (31)
- # cljs-dev (52)
- # clojure (162)
- # clojure-australia (10)
- # clojure-europe (52)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-uk (5)
- # clojurescript (40)
- # conjure (6)
- # core-async (3)
- # cursive (5)
- # datalevin (11)
- # datomic (7)
- # emacs (12)
- # etaoin (19)
- # events (1)
- # figwheel-main (17)
- # fulcro (4)
- # graalvm (3)
- # gratitude (13)
- # honeysql (8)
- # introduce-yourself (7)
- # london-clojurians (1)
- # off-topic (9)
- # polylith (9)
- # rdf (1)
- # re-frame (21)
- # releases (5)
- # remote-jobs (4)
- # sci (28)
- # shadow-cljs (15)
- # spacemacs (2)
- # vim (4)
- # xtdb (15)
Hello Team, I’ve got multiple root folders inside my workspace from multiple repos. Clojure-lsp server info picks up the very first root folder to set the project-root-uri
value. Unfortunately this is the incorrect one. Is there a way to configure the value? I didn’t find anything in VScode that let’s me set a root project folder.
I don't think Calva offers a way to do this... We probably can make it so. Please file an issue about it.
You might get away with placing a deps.edn
in the root folder that is picked up and use :local/root
to point it at the root that is the correct one. Not sure if clojure-lsp
will play along...
no worries, thanks
My solution to that was to put .lsp/config.edn
in the "first" root folder pointing to the correct "root" deps.edn
and I added a shell script to compute the classpath since my "default classpath" requires aliases to be specified.
{:project-specs [{:project-path "<root-path>/deps.edn"
:classpath-cmd ["./.lsp/classpath.sh"]}]}
and
#!/bin/sh
cd <root-path> && clojure -Spath -M:build:dev:everything:runner:test
Ugly, but it works 🙂Aside from restarting LSP, is there an easy way to refresh kondo lint errors after making changes to the kondo config? I’m finding that I have to restart LSP/kondo to get those changes to take, which can be very time consuming.
if you change a kondo config, and edit the file, clojure-lsp will already use the updated config, but keep in mind that it will not update all project diagnostics, a restart does that for you
Gotcha. I guess then my question is whether it was possible to update project diagnostics after making config changes to avoid a restart. I could imagine why that might be complicated, I imagine the most correct thing to do would be to rerun kondo over the entire classpath after a config change? Though to me the biggest frustration is that errors stay around in files that I have open. Do you think there’s an easy solution that would do something like reset the diagnostics for open files after changing the config?
yeah, scanning the whole project would not worth as a restart already does that, scanning open files would work I guess, but the effort to implement that would not worth as well IMO
I agree about not worth it. It might not even be what the user wants right then and there.
You can make a #joyride script that stops and starts the clojure-lsp server and bind it to a keyboard shortcut. Won't save much time, but at least be quite convenient.
Totally get priorities and such, this is a nice-to-have. I was hoping to avoid having to restart LSP all together just to change the kondo config, but maybe I’m just impatient 🤷
I think clojure-lsp will not be very useful during the update of all project diagnostics, wether it is from a restart or not. And it will take roughly the same amount of time. The win would be a convenience thing. If you do that #joyride clojure-lsp stop/start on a file-watcher. you'll have something very similar to what it would be like if clojure-lsp did the full update automatically.