@ericdallo Testing the nightly build for the namespaced map support. It doesn't appear to be working for me.
Calva version used: v2.0.536
clojure-lsp version used: 2025.10.13-18.02.26-nightly
clj-kondo version used: 2025.07.28Sorry forgot the colon above, but it's still burying the appropriate response when done properly. I would expect :valueType to be the only suggestion when using the namespaced map.
It is correct when it's not namespaced.
Are you sure those completions come from Clojure-lsp only? Can you enable lsp-log-io variable and then check lsp-log buffer to check what server is returning when completing?
I'm using Calva, so yes
I'm not sure how to do what you requested
let's first make sure you are using the nightly build
See above
hum look correct
This is how it looks to me, so I wonder if it it's related with calva
do https://calva.io/clojure-lsp/#viewing-the-logs-between-the-client-and-server
so we can see what clojure-lsp is returning for that completion
So what you have is coming from the same file. What I'm working with is coming from Datomic
Though I do have it also in the same file given that it's defining the schema
yeah, not the issue here
I created tests for that case too
Checking
The log is huge. Which part should I be looking for?
check for completion response
You can restart LSP and do minimal things to repro, reducing this log
2025-10-14T13:07:21.899Z INFO [clojure-lsp.handlers:257] - :lsp/completion 11ms - total items: 1
2025-10-14T13:07:21.900Z DEBUG [clojure-lsp.server:60] - [Trace - 2025-10-14T13:07:21.900Z] Sending response 'textDocument/completion - (19)'. Request took 12ms.
Result: [ {
"text-edit" : {
"new-text" : ":valueType",
"range" : {
"start" : {
"line" : 6,
"character" : 8
},
"end" : {
"line" : 6,
"character" : 10
}
}
},
"label" : ":valueType",
"kind" : 14,
"detail" : "",
"data" : {
"unresolved" : [ [ "documentation", {
"name" : "valueType",
"uri" : "...",
"name-row" : 9,
"name-col" : 5
} ] ]
},
"score" : 11
} ]Does seem to be a Calva issue
yeah, my suggestion is to check if calva is adding any other completion backend like REPL or something
@pez Is this the case?
What's not making sense to me though is that when it's not a namespaced map :valueType is the only suggestion, as per above
yeah, also, if clojure-lsp is returning, I'd be expecting that calva is using that. Maybe you can compare both completions of namespaced and not namespaced in the logs and check if there is any big difference that may affect calva showing or not
Calva can be configured to use both lsp and repl or just one or the other, and you can configure which has preference.
For :i I'm getting
2025-10-14T13:16:20.365Z INFO [clojure-lsp.handlers:257] - :lsp/completion 13ms - total items: 4
2025-10-14T13:16:20.365Z DEBUG [clojure-lsp.server:60] - [Trace - 2025-10-14T13:16:20.365Z] Sending response 'textDocument/completion - (97)'. Request took 14ms.
Result: [ {
"text-edit" : {
"new-text" : ":id",
"range" : {
"start" : {
"line" : 6,
"character" : 8
},
"end" : {
"line" : 6,
"character" : 10
}
}
},
"label" : ":id",
"kind" : 14,
"detail" : "",
"data" : {
"unresolved" : [ [ "documentation", {
"name" : "id",
"uri" : "...",
"name-row" : 15,
"name-col" : 40
} ] ]
},
"score" : 11
}, {
"text-edit" : {
"new-text" : ":ident",
"range" : {
"start" : {
"line" : 6,
"character" : 8
},
"end" : {
"line" : 6,
"character" : 10
}
}
},
"label" : ":ident",
"kind" : 14,
"detail" : "",
"data" : {
"unresolved" : [ [ "documentation", {
"name" : "ident",
"uri" : "...",
"name-row" : 108,
"name-col" : 24
} ] ]
},
"score" : 11
}, {
"text-edit" : {
"new-text" : ":index",
"range" : {
"start" : {
"line" : 6,
"character" : 8
},
"end" : {
"line" : 6,
"character" : 10
}
}
},
"label" : ":index",
"kind" : 14,
"detail" : "",
"data" : {
"unresolved" : [ [ "documentation", {
"name" : "index",
"uri" : "...",
"name-row" : 258,
"name-col" : 7
} ] ]
},
"score" : 11
}, {
"text-edit" : {
"new-text" : ":isComponent",
"range" : {
"start" : {
"line" : 6,
"character" : 8
},
"end" : {
"line" : 6,
"character" : 10
}
}
},
"label" : ":isComponent",
"kind" : 14,
"detail" : "",
"data" : {
"unresolved" : [ [ "documentation", {
"name" : "isComponent",
"uri" : "...",
"name-row" : 153,
"name-col" : 5
} ] ]
},
"score" : 11
} ]Calva setting for definition provider:
Trying that, thanks
Some of the code blocks in this thread are too big for Slack it seems. I had to really fight to scroll down to here. Slack kept snapping me back to the start of the code block.
Unfortunately that made no difference
With lsp,repl
I'd expect to see in that completion popup (keyword) which are completion type info that come from LSP, maybe it's not using that?
I don't think Calva/VSCode shows that
Calva merges nrepl and lsp answers, iirc.
Then what is the purpose of the priority?
Actually it seems the setting wasn't sticking
When I clicked out of it the text would revert to repl,lsp
When restarting VSCode it also reverts to repl,lsp
@seancorfield There does not appear to be a setting to only use one or the other
Apparently not. I thought there was. And I'm also having problems changing it from repl,lsp to lsp,repl and getting it to stick.
Looks like we found a bug
I'll create an issue
Yup, no matter what I do in terms of selecting lsp,repl -- clicking, pressing enter, etc -- it reverts to repl,lsp if I even reload the window.
@pez https://github.com/BetterThanTomorrow/calva/issues/2951
It’s the VS Code settings editor that is being stupid with it, I think. The actual setting is changed, I also think. And even so. That setting won’t affect these completions. It’s for definitions. Completions are merged.
I don't see any other settings with that behavior
What are definitions then?
And no way to prefer completions from lsp?
If so that makes it very difficult to use namespaced maps in Calva
Definitions are what powers the Go to Definition command/feature in VS Code.
There’s no config for controlling the merge of completions.
The actual issue looks like something that should be fixed on the #nrepl side of things. Maybe it has been fixed even, Calva probably defaults to old versions. But also maybe it hasn’t. The namespaced map syntax is not very commonly used, I think.
Eric added support for it in clojure-lsp. It just isn't working correctly in Calva due to the merging
It would really be helpful to allow configuring the source and priority of completions in Calva
I actually see namespaced maps all the time in different projects, including very popular ones
@pez I agree with @mike.j.cusack, there should be a way to have access to Clojure-lsp completions ignoring nrepl or the nrepl ones not affecting the LSP ones
We try to be a bit restrictive with settings in Calva. It adds maintenance so needs to be really worth it. And to me it doesn’t make sense to not see repl completions. I’m not sure all those are even from the repl, so there may be some filtering that can be done. I think support for namespaces maps is best solved at the nrepl side of things.
@pez but cider-nrepl doesn't seem to support completion of #:db{:ind| } and many other that are LSP features like completion of destructured args... I believe it's user choice to use one or other
I don’t believe it is. 😃 But maybe something can be done with how things are merged, I haven’t had a look at it for a while.
Well, we support choosing definition provider, format provider and others that are features that both repl and LSP may provide and user can configure to use one or other, it would be weird only the completion feature do not follow that IMO
Does that mean that you'd get different behavior for #:db{:ind| } depending on whether you have Calva configured as lsp,repl vs repl,lsp? @pez
AFAICS from this issue, yes, I wouldn't expect merge to affect LSP results, but it seems it's affecting
@seancorfield no. The priority setting is about definitions, and do not affect completions.
> And to me it doesn’t make sense to not see repl completions. Why would there need to be both? To me the completions would be better from the LSP if using the LSP because REPL completions will only work for code that has been evaluated by the REPL, whereas the LSP uses static analysis and would be able to complete anything that has been saved in the buffers without needing to send to REPL.