lsp

JR 2026-02-26T20:55:54.668009Z

Question on :external? : I'm looking for the call sites of a function using (q/find-references-from-cursor db uri fn-row fn-col false). This works, but sometimes it returns two references for the one call site - one reference with :external? false and the other with :external? true . Everything else in the two references is the same. Same :row & :col, :uri, etc... It seems like :external? is set in kondo.clj to indicate that a kondo reference came from outside of the project's sources (eg a jar file). Why would I get back two references for one call with one being external?

ericdallo 2026-02-26T20:57:19.478689Z

I don't recall any case where we should return 2 references, that sounds like a bug 🤔 it's weird they being completely equal

JR 2026-02-26T20:58:16.083899Z

OK, thanks! Wanted to check that I have the right idea before I started looking for a bug

ericdallo 2026-02-26T20:58:46.869839Z

I hope it's a bug, if that means reduce analysis size when fixed which means less memory :)

JR 2026-02-26T20:59:14.203459Z

Right! I'll let you know

👍 1
JR 2026-02-26T22:13:16.657929Z

I think I see what's going on here. There are two things that I missed • I'm working on clojure-lsp • The two references are to the same function, but they are not exactly identical. One URI was coming from the clojure-lsp jar file and the other from the sources

:uri "file:///home/jr/Projects/clojure-lsp/clojure-lsp:clojure_lsp/refactor/transform.clj",
vs
:uri "file:///home/jr/Projects/clojure-lsp/lib/src/clojure_lsp/refactor/transform.clj",
(hard to notice) When I restarted clojure-lsp, the external jar file reference disappeared. I'm not sure how it got there, but I imagine that it will come back, and I'll debug further

JR 2026-02-26T22:28:50.361659Z

Maybe this will only happen when attached to a running clojure-lsp? I've attached the REPL to the running clojure-lsp which will have the jar clj files, and then I'm reevaluating the same namespaces in the source files. (Although I still can't get it to reproduce on command)

ericdallo 2026-02-26T22:49:10.668709Z

Aha yeah, I thought it could be something like that, it's pretty common to cljs users face same when opening public folder wrongly

ericdallo 2026-02-26T22:50:02.856029Z

What you probably did was go to a definition that sent you to the jar? Even so Clojure-lsp shouldnt have a dep on Clojure-lsp itself so weird

ericdallo 2026-02-26T22:51:10.494099Z

Ah if you did something with the repl which created a temp buffer under, when accessing it lsp-mode/eglot would send a didOpen notification and Clojure-lsp would lint that file, generating analysis, very likely

ericdallo 2026-02-26T22:51:21.438849Z

I don't access jar things via repl tho always via lsp

JR 2026-02-26T23:37:42.953689Z

That sounds plausible. I'm mostly using Calva, and I did notice that it sometimes opens the jar file's sources, even for clojure-lsp files. It's annoying, but I couldn't figure out why. Maybe I accidentally introduced this when working on the performance tests, which do use the jar file? Anyway, I don't think it's a bug, unfortunately for the space issue. I'll try to keep my eyes open for it

ericdallo 2026-02-27T01:58:20.479949Z

Yeah never saw that on emacs or calva, still need to check the performance tests but as you say it makes sense