calva

JR 2026-01-16T14:23:02.118609Z

I saw that emacs now has https://clojurians.slack.com/archives/CPABC1H61/p1768501546315619. Was this added to calva somewhere? I tried searching for it but couldn't find anything

ericdallo 2026-01-16T14:23:52.114829Z

actually it's done in clojure-lsp so no client extra work is needed, completing inside the string or the map should work

seancorfield 2026-01-16T14:26:22.563259Z

It works for me in Calva for deps.edn but it has quirks. For example, add io.github.clojure/tools.build to your deps.edn and it suggests all the git dep versions but not the Maven (Clojars) versions. It suggests coords for the lib, but if you start typing the coords, you don't get auto-suggestions (which is where I would have expected it to happen).

ericdallo 2026-01-16T14:28:48.155569Z

Feel free to open a issue on how to improve it, that code was tricky to do, but it should be fixable

pez 2026-01-16T14:30:39.007489Z

It is quite quirky, yes. 😃

seancorfield 2026-01-16T14:32:57.516179Z

I guess my question would be: how exactly should it be expected to work? If I type io.github.clojure/tools.build {: I get the :git/tag auto-suggests. If I continue to type mvn/version " I do not get Clojars versions. I don't think I've ever seen it suggest versions inside the string, i.e., when I have this: io.github.clojure/tools.build {:mvn/version "|"} (where | is the cursor). Should I see completions there?

ericdallo 2026-01-16T14:34:56.195679Z

yeah that's the tricky thing, how we expect to behave. But yes, inside the string was supposed to work

JR 2026-01-16T14:34:58.364509Z

Ah, I see it working with @seancorfield’s io.github.clojure/tools.build example. I tried completing clojure.core.async and it came up with a bunch of libraries, and after I typed in clojure.core.async, it gave all sorts of things (symbols?) for the version. I figured it wasn't working...

ericdallo 2026-01-16T14:36:19.241669Z

we do have https://github.com/clojure-lsp/clojure-lsp/blob/b3eec66d1027875ee1e5acc145ff2c368047a222/lib/src/clojure_lsp/feature/completion_lib.clj#L34-L38 for inside a string, but maybe there is some corner case

JR 2026-01-16T14:36:54.809439Z

Sounds like something I could look into 🙂

❤️ 2
JR 2026-01-16T17:26:24.919349Z

It seems like this is my bad. I didn't know what the name of the library was and guessed clojure.core.async. It turns out that it's org.clojure/core.async. With that, it completes the library and the versions.

JR 2026-01-16T17:27:13.361069Z

I wonder if there's some way to map from the library name that some newbie types in to the actual name?

ericdallo 2026-01-16T17:27:42.191549Z

I believe one thing we could do as a extra new feature is: a info diagnostic when the the lib is not found in any of the sources we search, but I feel like it can cause false positives in some private libs cases so not sure it's a good idea

ericdallo 2026-01-16T17:28:17.887759Z

dunno it's worth it to map those names too, can't think in many more cases

JR 2026-01-16T17:28:51.577849Z

Yeah, I'll chalk this up to "bad user on device"

😅 1
JR 2026-01-16T17:28:56.321089Z

Thanks for the help!

seancorfield 2026-01-16T17:44:15.337309Z

> a info diagnostic when the the lib is not found in any of the sources we search, but I feel like it can cause false positives in some private libs cases In a Polylith repo, all the bases and components are pulled in as :local/root "libraries" -- that would be about 200 false positives for our setup at work so... I wouldn't be very happy about that 🙂

seancorfield 2026-01-16T17:46:29.000349Z

Part of the problem -- in general here -- is that the group/artifact ID of the library bears no connection to the namespaces that are inside it. clojure.core.async is a namespace. org.clojure/core.async is a group/artifact ID. LSP could special case some nses to lib names (basically clojure.X.Y => org.clojure/X.Y is relatively safe) but it could not do it in general.

ericdallo 2026-01-16T17:47:10.618019Z

> In a Polylith repo, all the bases and components are pulled in as :local/root "libraries" -- that would be about 200 false positives for our setup at work so... I wouldn't be very happy about that 🙂 Of course we could ignore for local/root, but yeah, for private libs and maybe other corner cases it could be a problem

ericdallo 2026-01-16T17:47:46.406869Z

hum, I wonder if we could use the same data from lsp-clojure-show-project-tree which we have lib names

seancorfield 2026-01-16T17:48:10.540389Z

But, given foo/bar as a libname, before the coords are entered, you can't tell if that's Maven, Clojars, git deps, or local...?

ericdallo 2026-01-16T17:48:53.046569Z

I don't think you can, you can search in all those, but not sure you can know for sure from where it comes

seancorfield 2026-01-16T17:51:52.269309Z

And then you have libraries like https://github.com/dm3/clojure.java-time where the group and artifact are both clojure.java-time which looks like a ns and you'd almost think org.clojure/java-time except it's really clojure.java-time/clojure.java-time (which, hey, blame the lib creator for a bad name there maybe?) and the ns is really java-time.api. I can't imagine any useful diagnostic here that wouldn't trigger false positives in a reasonable number of cases.

ericdallo 2026-01-16T17:58:42.863349Z

yeah me too

clyfe 2026-01-16T19:52:16.777609Z

Would be nice to have Calva Spritz published on open-vsx too. cc @pez

pez 2026-01-16T20:29:04.333709Z

Ah, I didn’t know it wasn’t. Should be easy to fix. Please file an issue.

clyfe 2026-01-17T06:45:22.606169Z

Issue filed https://github.com/BetterThanTomorrow/calva/issues/2986.

🙏 1