Fork me on GitHub
#lsp
<
2024-01-11
>
Alexander Kouznetsov00:01:00

Q: when I click on the FQN of a clj-kondo hook I often end up in a .clj-kondo folder where a copy of clj-kondo.exports is stored. How can I configure clojure-lsp to always bring me to the original exports file instead if it is in the same project tree? Example: my-sub-project/resources/clj-kondo.exports/my-company/my-sub-project/ns_hooks.clj contains the hook definition as well as it is copied by clj-kondo into .clj-kondo/my-company/my-sub-project/ns_hooks.clj and command-click brings me here while I want to end up in the former file. This confuses me as I may edit the former file (which is not checked into the repo) and then observe an effect that others can’t reproduce since they only have the original file.

ericdallo00:01:57

Not sure if it's that simple, what happens if the hook is not form your project but form another one?

Alexander Kouznetsov00:01:57

Probably a reasonable place to be would be file in that project’s resources folder.

ericdallo01:01:25

the problem is that clojure-lsp analyze and knows what is in the classpath, probably that resources folder is not in the classpath, so it's unknown for clojure-lsp

Alexander Kouznetsov03:01:17

resources should be in classpath

Alexander Kouznetsov03:01:45

whereas .clj-kondo isn’t

ericdallo12:01:21

do you have a repro so I can try and understand a little bit better?

ericdallo01:01:35

🎉 gratitude clojurists-together

💰 5
🚀 5