This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-19
Channels
- # announcements (9)
- # babashka (5)
- # babashka-sci-dev (23)
- # beginners (160)
- # calva (78)
- # cider (23)
- # clj-commons (2)
- # clj-kondo (5)
- # cljdoc (19)
- # cljs-dev (8)
- # clojure (54)
- # clojure-australia (1)
- # clojure-czech (2)
- # clojure-dev (17)
- # clojure-europe (8)
- # clojure-italy (8)
- # clojure-nl (2)
- # clojure-sg (3)
- # clojure-uk (4)
- # clojurescript (70)
- # community-development (8)
- # core-async (8)
- # cursive (7)
- # datahike (12)
- # datalog (22)
- # datomic (20)
- # events (1)
- # fulcro (43)
- # graalvm (92)
- # gratitude (5)
- # holy-lambda (77)
- # honeysql (1)
- # jobs (1)
- # lsp (111)
- # membrane (70)
- # nextjournal (13)
- # off-topic (73)
- # pathom (1)
- # polylith (8)
- # portal (32)
- # re-frame (3)
- # reagent (4)
- # reitit (5)
- # releases (2)
- # reveal (4)
- # xtdb (22)
I've noticed that Calva isn't picking up aliases in my deps.edn
. For instance, I have a :dev
alias that only defines :extra-paths ["dev"]
, but when I print out the classpath I don't see dev
in there:
(doseq [p (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))]
(println (str p)))
Output:
file:/Users/zmitchell/code/clojure_web_dev/cardmates/src/
file:/Users/zmitchell/code/clojure_web_dev/cardmates/resources/
file:/Users/zmitchell/.m2/repository/cider/cider-nrepl/0.26.0/cider-nrepl-0.26.0.jar
file:/Users/zmitchell/.m2/repository/integrant/integrant/0.8.0/integrant-0.8.0.jar
...
This is my full deps.edn
:
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}
ring/ring {:mvn/version "1.9.4"}
metosin/ring-http-response {:mvn/version "0.9.1"}
metosin/muuntaja {:mvn/version "0.6.7"}
metosin/reitit {:mvn/version "0.5.11"}
selmer/selmer {:mvn/version "1.12.31"}
integrant/integrant {:mvn/version "0.8.0"}}
:aliases {:run-m {:main-opts ["-m" "zmitchell.cardmates"]}
:run-x {:ns-default zmitchell.cardmates
:exec-fn greet
:exec-args {:name "Clojure"}}
:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.4.0"
:git/sha "54e39ae"}}
:ns-default build}
:dev {:extra-paths ["dev"]}
:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}
io.github.cognitect-labs/test-runner {:git/tag "v0.5.0"
:git/sha "48c3c67"}}}}}
When I jacked-in I selected the :dev
alias, but I don't see dev
in the terminal output from the jack-in either:
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.26.0"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
WARNING: Implicit use of clojure.main with options is deprecated, use -M
nREPL server started on port 50084 on host localhost -
I'm on 2.0.218 for context.Well, I feel silly. It looks like there's a checkbox that wasn't getting checked next to the alias in the dropdown during jack-in. I was navigating with my keyboard and was just hitting enter on the highlighted alias.
Hm. Starting calva today (after reboot) gives me "Couldn't start client Clojure Language Client" in a small toast in the corner. Not sure yet what is affected, and can't see anything weird in "Calva says"
Heh, ok. I tried to jack in, and it says clojure cannot be found. Seems like for some reason it has lost the relevant folders from PATH
A problem completely outside Calva, but perhaps the original error could be made more explicit about clojure not being found?
Fixing the path (and it didn't bring anything except clj and clojure) did get rid of that error, though
In any case it is hard to report on clojure as missing when it is not involved in the error. 😃 clojure-lsp is a binary. No idea why it would need clojure or clj on the path. In fact I don’t think it does. I could be wrong, of course.
I think clojure-lsp uses clojure/clj to get the classpath during initialization for deps.edn projects. @UKFSJSM38 Do you think a more detailed error could be given from clojure-lsp when initialization fails?
Maybe it should use deps.clj
instead? Maybe it could be used as a library by clojure-lsp even? WDYT, @U04V15CAJ?
@U0ETXRFEW Perhaps as a fallback when clojure
cannot be found? Perhaps @U8ZQ1J1RR is on Windows? /cc @UKFSJSM38
Perhaps people have installed a newer (or older) version of clojure
specifically for some bug fixes or so
Then it is probably better to just do it as a fallback. Then clojure-lsp would just work even before clojure
is installed, and also when it is installed.
clojure-lsp should start even without clojure, the clojure command is used only for detecting classpath of deps.edn project and clojure-lsp logs the error on it's log file
yes, and when clojure is missing it can't, that is what @U0ETXRFEW is referring to
It seems we would remove a external dependency that may not be available for user and rely only on the deps.clj lib, it sounds good to me, please open an issue
But @U04V15CAJ also expressed reasons to only use deps.clj as a fallback in this same thread. Not sure if you saw that, @UKFSJSM38?
yeah the reason would be that the installed clojure version might be using a different tools jar version (and hence tools deps alpha) because something was broken in a newer or older version.
yes, and/or apply configuration setting in .lsp/config.edn
to use the built-in deps stuff
Yeah, but also makes for more documentation that most people don’t need to read. It’s a trade-off, of course. Settings/configuration need to carry their weight, I think. I’m a Getting Real kind of guy, Make the call 😃 https://basecamp.com/gettingreal/06.4-avoid-preferences
I don't really agree with that take. You can have options but hide them on the first glance. You can make a section with more advanced options for example where people only need to look in case of these triaging issues.
It comes down to: when shit hits the fan, give yourself options. (like: yes, a REPL in production)
Yep, Lots of possibilities. 😃 Still, settings need to be maintained. I try to avoid them as long as I can, and only add when I need to.
> It’s different from: let clients choose 100 different colors for their outer parens Calva users can. 😃
Sure. But in a case like this, you don't want to mess with how dependencies are downloaded unless users explicitly agree, I think
We agree on deps.clj only being used as a fallback. I’m only questioning the make-it-a-setting part.
Even if you use it as a fallback, you might want to have the option to "force" using it, e.g. when there is something wrong with the fallback logic, or otherwise (clojure / powershell install is detected, but doesn't work for some reason).
Also people might want to opt into deps.clj not as a fallback, because it has some options (e.g. selecting a different tools jar)
Didn't quite read the thread, but no, heh, I'm not on Windows. deps.edn projects on Linux, though that error comes before I try to jack in so I don't know if that really matters
@U8ZQ1J1RR It’s not related to jack-in, just FYI. It’s related to clojure-lsp initializing when you open a Clojure project in VS Code. The deps.clj fallback sounds like a good idea. I don’t think it would solve the problem of a similar issue happening with a lein project, but at least it fixes the deps.edn project issue.
Sure, though I don't quite understand which parts are calva and which lsp, but at least you know the context from here
Calva v2.0.219 out. It updates the syntax grammar to better match the semantic tokens we get from clojure-lsp and also provides mappings token->grammar so that the semantic aware themes knows how to style the tokens to match the grammar. To the user this translates to much less visual flicker when clojure-lsp is started and when new files are opened. See https://clojurians.slack.com/archives/CBE668G4R/p1634586719164700 for the longer story.
Something very odd has happened with the repl output. Before, a lazy seq of maps pretty printed the maps (each key-value on a separate line etc) and only printed some values. Now it all gets out, in one long stream without any formatting
Coloring seems to depend on data size. Just a couple of lines worth of data gets the usual colors of blue kws, red strings etc, but longer output is just white
I’ve confirmed this. It may be related to this change: https://github.com/BetterThanTomorrow/calva/pull/1342. CC @U0ETXRFEW
@U0ETXRFEW, if I click the button in the status bar to turn pretty printing off, then click it again, pretty printing works. Before that, though, pretty printing does not work even though it’s enabled.
I’ve created an issue for this: https://github.com/BetterThanTomorrow/calva/issues/1351
Thanks for reporting, both of ya! As for coloring. VS Code doesn’t syntax highlight lines above a certain length, for performance reasons. I think that is what might explain the whiteness. You can confirm that, @U8ZQ1J1RR, by decreasing the limit dramatically and throw evaluation that result in short ranges of forms at the REPL.
That makes sense, I guess, and I don't really have a need to highlight that long lines anyway. They are already unreadable
Hey everyone. I’ve noticed that I’m not longer getting the helpful auto-creation of the namespace header, eg (ns my-new.file)
, upon creation of a new file. Is this a setting that I may have accidentally disabled?
Seems like it’d be an issue with clojure-lsp: https://calva.io/namespace-form-auto-creation/
Hi! Are you on Windows, perhaps? There is also this clojure-lsp related issue: https://github.com/BetterThanTomorrow/calva/issues/1350
I think that one could be a regressions from when we upgraded the language client dependencies.
You can try with version 216 of Calva and see if it works there. If it doesn’t, then this could be clojure-lsp itself somehow and you could try with some older version of that.
Hey folks, recently I have been experiencing this problem on multiple different projects, where when I try to Calva JackIn (or connect to a running REPL) the Output Panel hangs and does not connect properly, hanging in the ; Jacking in...
phrase. Usually I need to Quit and re-open the VSCode to be able to JackIn with success again, not sure exactly when it started to happen, but I believe it was about a month ago or so. Anything that changed that could be related to this problem?
I have the exact same problem and have not been able to figure that out @leoiacovini
I can’t recall anything special changing in Calva that would cause that. It would be great if you could test that. Check the Changelog for info about where to start some bisecting. VS Code makes it easy to use older versions of an extension, but of course, it is quite a lot of work. It needs to be done on a machine where we can repro this, though….
Yeah we talked about this already. There is not really a precise way to replicate this, and I cannot tell whether is the nrepl that is not working or Calva that’s struggling to connect to the nrepl
I do recall when trying to connect Calva manually to the allegedly running Repl I received a socket error or something like that
I’m thinking: If you run with an older version of Calva a couple of days, and this doesn’t happen, then we might have an indication that this is a change in Calva causing it.
I will try to run some bissections, but its kinda hard to get this tested because the error is intermittent and seems to happen just after the VSCode is opened for some time (dirty state? ENV/Creds caching?). Anyway, I will try to dig a bit deeper
Yes, very tricky to catch this one. And there is still the possibility that it is something outside that has changed, that we can’t catch by bisecting Calva versions…
I have the exact same problem and have not been able to figure that out @leoiacovini