clj-kondo

julienvincent 2025-12-19T10:51:12.928859Z

Ok I have another follow on question from the above: I am wanting to make a defprotocol macro which produces a protocol and generates another var alongside. Here is a minimal example of what I am trying to do:

(ns hooks.io.julienvincent.example
  (:refer-clojure :exclude [defprotocol])
  (:require
   [clj-kondo.hooks-api :as api]))

(defn defprotocol [{:keys [node]}]
  (let [[_ name-node & rest-children] (:children node)
        protocol-node (api/list-node
                       (into [(api/token-node 'defprotocol)
                              name-node]
                             rest-children))

        name-sym (api/sexpr name-node)
        additional-node-name (symbol (str "?" (name name-sym)))
        additional-node (api/list-node [(api/token-node 'def)
                                        (api/token-node additional-node-name)
                                        (api/token-node 'nil)])]

    {:node (api/list-node
            [(api/token-node 'do)

             ;; Protocol node first otherwise we lose references
             protocol-node

             (with-meta additional-node (meta name-node))
             ;; Generate fake usage to prevent clojure-lsp from reporting
             ;; unused-var warnings
             (with-meta (api/token-node additional-node-name) (meta name-node))])}))
Usage looking like:
(ns io.julienvincent.kondo-test
  (:require
   [io.julienvincent.example :as example]))

(example/defprotocol Example
  (foo [x]))

;; The base protocol is here
(reify Example
  (foo [_] 1))

;; This is the extra node I produced
(println ?Example)
--- The problem I am having is with references. I can't find a way to 'combine' references for both the protocol and the additional var. If I go-to-references from the macro protocol definition then it will only find references for the first node exported in the clj-kondo hook (the protocol in this case) and won't find the following nodes (such as the var ?Example in this case). If I go-to-definition from usages of the var ?Example it does correctly take me to the definition, just not the other way around. Is this just a core limitation of the systems at play or is there perhaps a way to do what I want here? i.e is there a way to ensure ?Example is included in references to my Example macro definition in addition to the protocol.

✅ 1
julienvincent 2025-12-30T10:50:43.063669Z

So I attempted to recreate your success with AI and got codex to fix the above for me: https://github.com/julienvincent/clojure-lsp/commit/fef6e0bf691b8090a3650644ca0a69dc3b01f84e The changes were much more extensive, and I didn't read any of it (I have no familiarity with the code-base anyway), but this does allow me to at least try out the user-experience of the solution locally. I can confirm that the approach of substring renaming works pretty well - at least for my limited testing and at least for my use-case. I gave instruction to attempt a rename using the existing mechanism (but for all discovered references) and then fall back to a substring replacement if no text was changed at a particular usage location. Do with this what you want :)

ericdallo 2025-12-30T13:11:30.277229Z

Cool, interesting, will take a look soon, the good thing is that the rename is well tested

julienvincent 2025-12-30T17:11:24.734409Z

Yea it is from what I saw. Also that implementation seems entirely contained to the rename operation and mostly contains additions it seems. Based on that I would imagine a real implementation to be quite feasible

ericdallo 2025-12-29T18:14:07.279569Z

Back at this, the issue is well described and clear, thank you @m401! Actually it was so clear, I gave a try just to see how good ECA would solve this with a simple prompt of "solve the issue #2176", and sonnet-4.5 solved in 2mins with https://github.com/clojure-lsp/clojure-lsp/commit/484b4eac682a1c9df1f611ca30607151aae0cb72 😅🫠 kinda scary he The good thing was the solution change was well localized LMK if nightly works the same for you @m401! The print shows the result when finding references from the definition, showing the 2 places

julienvincent 2025-12-29T18:15:24.935919Z

Wow that's actually insane! Guess we are all out of a job ;) I saw the issue get closed and I'm already on it to see if this works for me! Will report back shortly

😂 1
ericdallo 2025-12-29T18:16:23.695049Z

The solution was kinda easy, after you understand the problem, and I think that's the thing LLM suites really well, understanding and giving you context about a problem

julienvincent 2025-12-29T18:19:44.789279Z

Yea, and it found the convenient find-[all]-elements-under-cursor existing fn. That's cool

ericdallo 2025-12-29T18:21:54.985919Z

exactly hehe

julienvincent 2025-12-29T18:23:44.559839Z

aand of course the macos-aarch64 nightly job is the slowest to complete 😭

😅 1
julienvincent 2025-12-29T18:38:08.423489Z

Ok, I can confirm that the issue as described is fixed! One caveat being that rename does not work. I suppose this is expected. I was assuming when I raised this that it would "just work" once references work, but now that I think about it I assume this must be a completely different mechanism.

julienvincent 2025-12-29T18:38:35.088409Z

So.. is there a way to get renaming to work as well? I guess that isn't powered by clj-kondo

ericdallo 2025-12-29T18:39:11.272059Z

ah yeah, especially because there are 2 var-definitions there... can you give a example of a renaming? just to make sure I understand the desired result

julienvincent 2025-12-29T18:41:25.752159Z

Sure, to keep the same example as before - renaming the definition should rename all the references. Kind of how renaming (defrecord Point) to (defrecord Point2) will rename ->Point2 and map->Point2. But I don't see how this will be possible, because the name of Example1 and Example2 (from my issue example) are determined by the hook. So clojure-lsp would need to.. re-eval the hook before renaming??

ericdallo 2025-12-29T18:42:00.321829Z

exactly

ericdallo 2025-12-29T18:42:14.130029Z

I can't see a way to solve that because of that

julienvincent 2025-12-29T18:42:32.826949Z

is the defrecord scenario special-cased in clojure-lsp?

ericdallo 2025-12-29T18:43:05.266169Z

no, the issue is the custom naming, like Example for definition but the references are ?Example and ?Example2

julienvincent 2025-12-29T18:43:24.512609Z

Yea but defrecord var names also don't match the source?

ericdallo 2025-12-29T18:43:56.647569Z

ah, there is special handling for defrecord yes, just for map-> and ->

ericdallo 2025-12-29T18:44:13.786549Z

we look especificaly for those

julienvincent 2025-12-29T18:44:59.263379Z

Perhaps we can explore how this might look in an ideal future. There would need to be some interaction with clj-kondo I presume, in a way where the special casing for defrecord could be described entirely from kondo

julienvincent 2025-12-29T18:46:06.118329Z

but that would mean kondo would need to understand the implications of renaming something.. which feels out of scope for what its doing

julienvincent 2025-12-29T18:47:47.659859Z

Without knowing anything about the internals of clojure-lsp, would it be feasible for clojure-lsp to re-run the hook and correlate new var names based on reported index?

ericdallo 2025-12-29T18:47:52.089959Z

yeah, or maybe we could fallback for something like: renaming "Example" -> "ExampleFoo" we would get the references and kinda replace the Example -> ExampleFoo , resulting in ?ExampleFoo2

ericdallo 2025-12-29T18:48:13.112379Z

not easy to re-run the hooks, they happen after the code was changed, after the rename

julienvincent 2025-12-29T18:48:33.127669Z

yea so it would need to be a two-phase rename, which feels stupid

julienvincent 2025-12-29T18:48:45.426909Z

Your solution sounds like it would work for most cases

ericdallo 2025-12-29T18:48:55.550999Z

I guess, we could explore that

julienvincent 2025-12-29T18:48:57.716529Z

I'm sure someone could write a funky hook where that would not work

ericdallo 2025-12-29T18:49:06.413379Z

please create a new one to help keep track

ericdallo 2025-12-29T18:49:10.820729Z

yes, indeed

julienvincent 2025-12-29T18:49:24.030499Z

Ok! I'll get to it in a few

julienvincent 2025-12-29T22:30:59.528709Z

Issue tracked here: https://github.com/clojure-lsp/clojure-lsp/issues/2183

❤️ 1
julienvincent 2026-01-02T11:10:18.948569Z

FYI here is another related issue: https://github.com/clojure-lsp/clojure-lsp/issues/2192 Again, I got AI to fix this in my local fork so I can try out the proposed solution. The solution it produced looks pretty good, with very minimal changes

julienvincent 2026-01-02T12:22:35.147979Z

I decided to open a PR with the patch

ericdallo 2026-01-02T15:47:16.171319Z

@m401 does that happens to unused-private-var as well? Will take a look later, thanks

julienvincent 2025-12-19T10:55:00.177639Z

I would suspect this is a limitation in clojure-lsp @ericdallo is that correct? As clj-kondo does have all the information.

borkdude 2025-12-19T10:55:17.688639Z

It's probably an LSP issue. If you look at the exported analysis data, the var + location should be there and this is all LSP should need

✅ 1
borkdude 2025-12-19T10:55:50.316119Z

try it out and see if the data is correct

julienvincent 2025-12-19T10:56:16.907869Z

Reading

julienvincent 2025-12-19T11:20:40.919539Z

So, in the analysis the defined-by says def, not my macro. I'm not sure if that's relevant?

"var-definitions": [
      {
        "end-row": 6,
        "name-end-col": 26,
        "name-end-row": 5,
        "name-row": 5,
        "ns": "io.julienvincent.kondo-test",
        "name": "?Example",
        "defined-by": "clojure.core/def",
        "filename": "clj-kondo-test/io/julienvincent/kondo_test.clj",
        "col": 1,
        "name-col": 19,
        "defined-by->lint-as": "clojure.core/def",
        "end-col": 13,
        "row": 5
      },

julienvincent 2025-12-19T11:21:22.254529Z

is lsp just using the location information?

borkdude 2025-12-19T11:21:47.626239Z

it's defined by def since your macro expands into defining the var using def

julienvincent 2025-12-19T11:22:12.425459Z

I simplified the example to have my macro just produce two identacal (do (def ?Example nil) (def ?Example2 nil)) nodes, both pointing to the same location and only the first one has reference (via lsp). The clj-kondo analysis looks identical for both

borkdude 2025-12-19T11:22:34.854539Z

anyway, the location is there and this is all lsp needs. take it up with Eric :)

julienvincent 2025-12-19T11:23:07.570169Z

Ok! I will wait for his maybe reply here :)

ericdallo 2025-12-19T12:45:36.527239Z

clojure-lsp resolves that by ns, name and location if both have the same it should work we don't do custom stuff for that, let me test your repro

julienvincent 2025-12-19T12:50:22.921769Z

If you give me 10 mins I can prepare a repro repo for you

ericdallo 2025-12-19T12:50:36.530329Z

that will certainly help!

julienvincent 2025-12-19T12:56:49.653569Z

https://github.com/julienvincent/clojure-lsp-references-repro - here you go! If you go to the io.julienvincent.kondo-test ns you can see that references to Example only go to the first var

ericdallo 2025-12-19T12:57:56.663369Z

thanks, cloning it

ericdallo 2025-12-19T13:07:28.883919Z

ok, let me check if I understand the problem because I suspect this is expected: I believe this is enough for the discussion, you have:

1 (ns foo)
2
3 (defmacro defthings [_name]) ;; find-references should return line 5 only, as it's the only defthings usage.
4
5 (defthings Example) ;; find-references in Example should return lines 5 and 7, find-definition goes to itself, line 5
6
7 (println ?Example) ;; find-references in ?Example should return lines 5 and 7, find-definition goes to line 5
isn't that expected?

ericdallo 2025-12-19T13:08:14.142089Z

if you want to find ferences of the defthings in line 3 and return line 7, then this is pretty uncommon, not sure if we support even changing the locs, as the names won't even match

julienvincent 2025-12-19T13:10:23.047099Z

Not quite the problem: The macro (defthings Example) produces two vars: ?Example and ?Example2. If you look at the clj-kondo hook you can see we define these two nodes. Only the first node reported by the hook is included in references to the macro call (defthings Example). The (println ?Example2) reference is 'lost' when searching from the macro call

julienvincent 2025-12-19T13:11:34.102279Z

I.e performing a find-references from (defthings Example) finds only (println ?Example) and not (println ?Example2)

ericdallo 2025-12-19T13:11:47.214399Z

ah sorry, I misread the hook

ericdallo 2025-12-19T13:12:44.010789Z

I see the problem, let me deep dive to understand why happens

❤️ 1
ericdallo 2025-12-19T13:14:00.942089Z

BTW, there is a quick way to test analysis, if you use emacs or calva, lsp-clojure-cursor-info it shows analysis, semantic tokens etc of cur cursor, pretty useful to debug hooks and so

julienvincent 2025-12-19T13:14:31.948419Z

Neovim all the way 🤘

ericdallo 2025-12-19T13:15:10.461679Z

haha it should be easy to have the same in neovim, as it's a server command

✅ 1
borkdude 2025-12-19T13:15:20.113609Z

I know people who use emacs because it's a better vim. I can't attest since I don't know vim at all ;)

julienvincent 2025-12-19T13:15:47.306729Z

@borkdude Do you want to start a war? Here? Now!?? :P

borkdude 2025-12-19T13:15:54.929959Z

let's take it outside

borkdude 2025-12-19T13:16:20.579739Z

😂

ericdallo 2025-12-19T13:16:41.718459Z

there is room for any editor, even the bad and ugly ones

😅 1
borkdude 2025-12-19T13:17:22.402289Z

you mean emacs right?

👀 1
julienvincent 2025-12-19T13:17:31.167659Z

My duckling is beautiful to me

borkdude 2025-12-19T13:17:54.501709Z

neovim starts fast which is a great feature

julienvincent 2025-12-19T13:18:19.602449Z

Starts fast, dies slow

ericdallo 2025-12-19T13:20:35.954429Z

I believe I found the root cause, it's because during find-references feature, we check for the https://github.com/clojure-lsp/clojure-lsp/blob/f555e4b89a1a3aa8aa9f66809f0d5e4dc034c61d/lib/src/clojure_lsp/queries.clj#L540 with https://github.com/clojure-lsp/clojure-lsp/blob/f555e4b89a1a3aa8aa9f66809f0d5e4dc034c61d/lib/src/clojure_lsp/queries.clj#L536 for defrecord,deftype (map->, ->, etc)

ericdallo 2025-12-19T13:21:37.264769Z

not sure the best way to fix that but would be certainly a new feature, like kondo pass some kind of analysis and lsp use that, not sure we want that

ericdallo 2025-12-19T13:22:35.978039Z

this becomes clear when you see the macro expansion, there is nothing that co-relates the ?Example with ?Example2, they are just different vars being defined by the same macro

julienvincent 2025-12-19T13:23:49.366519Z

What scenario is that filter accounting for? Is it just a safety net, or are there good reasons to do this check in the first place? I.e why is references pointing to same location not enough

ericdallo 2025-12-19T13:25:44.769039Z

that's a very good question :)

ericdallo 2025-12-19T13:26:53.818019Z

from git blame, we added in 2022 to exclude declare when calculating unused-public-vars, but it's not clear if that's still a issue, and probably there are other ways to filter now that we have :defined-by 'declare

ericdallo 2025-12-19T13:30:18.919439Z

https://github.com/clojure-lsp/clojure-lsp/issues/840

julienvincent 2025-12-19T13:31:19.077299Z

... and waiting to see if anyone complainsI'm complaining! :D

😂 2
ericdallo 2025-12-19T13:32:17.516499Z

yeah, removing that check doesn't break tests which is bad, I can't see easily now a case where not checking the name will cause issues

ericdallo 2025-12-19T13:35:38.988159Z

actually some tests fail, let me check

ericdallo 2025-12-19T13:49:27.498399Z

Hum, that filter by name is quite important, is actually the only reliable way to know a var-usage somehwere in the code is related to that definition, because the ns and name must match, otherwise how you could tell only by location? Example: (defthings Example) var-def:

{:name-row 5 :name-col 12 :name-end-row 5 :name-end-col 19
 :row 5 :col 1 :end-row 5 :end-col 20
 :external? false
 :ns io.julienvincent.references
 :name ?Example2
 :defined-by clojure.core/def
 :defined-by->lint-as clojure.core/def
 :callstack [{:ns clojure.core :name def} {:ns clojure.core :name do}]
 :uri "..."
 :meta {}
 :bucket :var-definitions}
?Example var-usage:
{:row 7 :col 10 :end-row 7 :end-col 18
 :name-row 7 :name-col 10 :name-end-row 7 :name-end-col 18
 :external? false
 :name ?Example
 :from io.julienvincent.references
 :to io.julienvincent.references
 :context {}
 :uri "..."
 :bucket :var-usages}
?Example2 var-usage:
{:row 8 :col 10 :end-row 8 :end-col 19
 :name-row 8 :name-col 10 :name-end-row 8 :name-end-col 19
 :external? false
 :name ?Example2
 :from io.julienvincent.references
 :to io.julienvincent.references
 :context {}
 :uri "..."
 :bucket :var-usages}
I can't see a way to co-relate those if not using the ns and name when finding references, the location on usages, say nothing to solve this problem

borkdude 2025-12-19T13:52:53.880019Z

doesn't clj-kondo already tell you which namespace and name it is? I don't understand the problem

borkdude 2025-12-19T13:53:24.458549Z

you have a var def for Example2 and a usage of Example2, what's the problem?

ericdallo 2025-12-19T13:57:01.097009Z

ah you are right, the problem is: we have 2 var-defs for the same position! I actually mispasted: (defthings Example) var defs:

{:row 5 :col 1 :end-row 5 :end-col 20
 :name-row 5 :name-col 12 :name-end-row 5 :name-end-col 19
 :ns io.julienvincent.references
 :name ?Example
 :external? false
 :defined-by clojure.core/def
 :defined-by->lint-as clojure.core/def
 :meta {}
 :callstack [{:ns clojure.core :name def} {:ns clojure.core :name do}]
 :uri "..."
 :bucket :var-definitions}

{:row 5 :col 1 :end-row 5 :end-col 20
 :name-row 5 :name-col 12 :name-end-row 5 :name-end-col 19
 :external? false
 :ns io.julienvincent.references
 :name ?Example2
 :defined-by clojure.core/def
 :defined-by->lint-as clojure.core/def
 :callstack [{:ns clojure.core :name def} {:ns clojure.core :name do}]
 :uri "..."
 :meta {}
 :bucket :var-definitions}
so this is the different thing that's affecting clojure-lsp

ericdallo 2025-12-19T13:57:06.508979Z

let me check

borkdude 2025-12-19T13:58:19.396949Z

perhaps you do a group-by on location or so? or index-by or whatever, which assumes 1 var per location

borkdude 2025-12-19T14:00:02.979629Z

maybe it's better to use group-by or so then?

borkdude 2025-12-19T14:00:34.643419Z

is :name the var name?

borkdude 2025-12-19T14:00:52.563129Z

in that case it shouldn't be a problem since the name is different?

ericdallo 2025-12-19T14:01:00.788209Z

I think the problem is not in the references, but the var-defnition that comes https://github.com/clojure-lsp/clojure-lsp/blob/f555e4b89a1a3aa8aa9f66809f0d5e4dc034c61d/lib/src/clojure_lsp/queries.clj#L535

ericdallo 2025-12-19T14:01:43.910089Z

the problem is https://github.com/clojure-lsp/clojure-lsp/blob/f555e4b89a1a3aa8aa9f66809f0d5e4dc034c61d/lib/src/clojure_lsp/queries.clj#L643-L648, like how we could know which var-definition from cursor we should look you know

ericdallo 2025-12-19T14:02:45.874889Z

the find-references is working, it's finding the references of the given var-definition, the problem is, when you have 2 var-defs with same exact position, which one should we use, or should we consider to use both? that sounds weird

borkdude 2025-12-19T14:04:18.334309Z

does it matter, since they are at the same location, the editor will bring you to the macro call?

ericdallo 2025-12-19T14:04:55.915989Z

yeah, we know the location will be the macro call, but the var-def in mmemory will have name ?Example not ?Example2

ericdallo 2025-12-19T14:05:21.111419Z

the point is that when one use the find-references feature, we first find the definition of it to then find the references

ericdallo 2025-12-19T14:05:58.706339Z

I think we could refactor the find-definition-from-cursor to return multiple elements, but there are 375 usages of that :) we would need to create some new or think in a better way

borkdude 2025-12-19T14:06:04.693969Z

you can use the name of the initiating position?

ericdallo 2025-12-19T14:06:43.514349Z

yeah, we could try to check for that

ericdallo 2025-12-19T14:10:44.654619Z

anyway, not trivial fix, we would need to take care there, create tests for clojure-lsp first to repro that and then try to fix it, It's still not entirely sure what parts of the codebase would be required to change becase those features are kind related for this problem, for example fixing the var-definition would not be enough, as it would just return the other var-def and then on find-references we would exclude the current selected one which is wrong, which let me think that maybe we would need to change find-references code as well. @m401 please create a issue, will require more deep diving

borkdude 2025-12-19T14:11:25.814469Z

doesn't LLMs solve all problems nowadays? 30% more productivity

ericdallo 2025-12-19T14:11:59.599609Z

ha! for sake of curiosity I can give ECA a try to see what's the outcome :p

borkdude 2025-12-19T14:12:12.718779Z

(this was a joke btw ;P, but worth a shot ;))

ericdallo 2025-12-19T14:13:08.417399Z

creating a clojure test that repro the problem would help for sure LLM find a way (maybe not the best he)

borkdude 2025-12-19T14:13:22.372889Z

hehe

ericdallo 2025-12-19T14:17:53.279559Z

it's kinda bizarre how it arrived at same conclusion of us in 1min after providing just the hook + usage and the issue:

Now I understand the problem. When the clj-kondo hook generates multiple definitions (like `?Example` and `?Example2`) from the same source location, they share the same `name-row` and `name-col` (since both use `(meta name-node)` for the name token).

When finding references for `?Example`, the current code:
1. Converts the var-usage to a var-definition with `{:ns ... :name '?Example :bucket :var-definitions}`
2. Searches for usages matching that specific name

The fix should find all var-definitions that share the same source position (`name-row`/`name-col`) and include all their names in the search.

Let me check if there's more context around how elements are found at a cursor position:

borkdude 2025-12-19T14:19:45.962379Z

This doesn't make sense to me. I thought you were trying to find var references for Example2

ericdallo 2025-12-19T14:22:07.732569Z

yes, it was my provided repro to it, the final decision was this in the plan mode:

The issue is clear: when clj-kondo hooks generate multiple var-definitions from the same source location (sharing `name-row`/`name-col`), find-references only returns usages for the specific var name being queried, not all co-located vars.

**Chosen Approach**: Modify `find-references :var-usages` to:
1. Look up the var-definition for the given var-usage
2. Find all other var-definitions in the same URI that share the same `name-row` and `name-col`
3. Collect all names from these co-located definitions
4. Find references for all of them

**Why this approach:**
- It respects the hook's intent: when multiple definitions share a source position, they're semantically related
- It's a minimal, targeted change to the existing find-references dispatch
- It follows the existing pattern used for `defrecord`/`deftype` (where `var-definition-names` already handles multiple names like `->RecordName` and `map->RecordName`)

**Alternative considered**: Modifying `var-definition-names` to also return co-located var names. However, this would require the var-definition to carry information about its position and require access to the db/analysis, which breaks the current pure function design.
I'm asking for preview file changes to understand how's gonna solve it, but it seems to be a brutal approach

julienvincent 2025-12-19T14:23:07.894219Z

This thread is making my week

julienvincent 2025-12-19T14:23:27.058209Z

I'm out for lunch but I'll write this up into an issue when I get back regardless :)

👍 1
borkdude 2025-12-19T14:24:07.487979Z

Let's first agree on the problem. Macro foo defines two vars: example1 and example2. When a user is on a usage of example2 and searches for references, you only want to see references of example2, not example1. Correct? So what lsp normally does: it goes from usage to definition and then to references. But because of locations overlapping, it somehow doesn't find example2.

ericdallo 2025-12-19T14:26:07.660689Z

yes, makes sense

ericdallo 2025-12-19T14:26:28.725659Z

we want the find-references from definition in the code to find both example1 and example2

borkdude 2025-12-19T14:26:56.624989Z

that is not what I wrote

julienvincent 2025-12-19T14:28:32.509639Z

Yea @borkdude I'm not following your description. Eric's comment describes the problem unless you ask trying to describe something else?

ericdallo 2025-12-19T14:28:41.462589Z

hum, I do think he wants to find references from the definition

julienvincent 2025-12-19T14:29:52.647219Z

Yes, find-references from definition is the problem from my perspective. Find references / find definition from Example2 should just point back to the definition - which it already does correctly

ericdallo 2025-12-19T14:30:34.325919Z

yeah that sounds more accurate

borkdude 2025-12-19T14:31:02.657929Z

Yeah ok. Two different scenarios then with potentially different outcomes. 1. Find references with cursor at (my-macro Example). It should find Example1 and Example2 references. 2. Find references with cursor at Example2. It should only find Example2 references?

ericdallo 2025-12-19T14:32:19.561779Z

yes, for me only 1 is what we want

julienvincent 2025-12-19T14:32:22.308769Z

For 2. It should go back to definition no? Not other references of the definition

ericdallo 2025-12-19T14:32:30.623359Z

yes, 2 already works

borkdude 2025-12-19T14:33:08.174579Z

This is scenario 2. My cursor was at the 3rd usage

julienvincent 2025-12-19T14:33:09.642289Z

Normal operation of lsp find-references of a usage just finds the definition afaik. Not at pc to confirm

borkdude 2025-12-19T14:33:28.624779Z

no, it doesn't just find the definition, it finds the references

julienvincent 2025-12-19T14:33:36.091909Z

Either way, the only operation I care about from a usage is going back to the definition - which already works

borkdude 2025-12-19T14:34:24.857319Z

Eric was mentioning that find references from a usage goes via the definition, which is why I understood that as the problem. It is also a problem, just not your original problem

julienvincent 2025-12-19T14:34:38.152479Z

Makes sense, agreed

julienvincent 2025-12-19T15:54:42.286059Z

Issue created here: https://github.com/clojure-lsp/clojure-lsp/issues/2176

🙏 1
ericdallo 2025-12-19T20:00:12.437979Z

thanks, I needed to left but will check it soon