Fork me on GitHub
#lsp
<
2024-02-11
>
parentheian21:02:37

is it still the case that clojure-lsp can not be informed of macros that turn into def/defn etc?

seancorfield21:02:37

LSP gets that data from clj-kondo, and clj-kondo can definitely be told about how to resolve macros -- all sorts of macros, not just defn-like ones.

seancorfield21:02:31

Increasingly, libraries are providing exported clj-kondo configurations that provide insight into macros, so that users of those libraries also get the clj-kondo configuration in their editor.

parentheian21:02:28

ok so given this is a library that I cant make open source can I just provide my own clj-kondo config or what not? I will dig into that realm then! thanks

seancorfield21:02:38

Yeah, if the library doesn't provide its own config, you can define your own. There's :lint-as and for more complex macros, there are "hooks" to provide pseudo-expansions.

parentheian21:02:41

oh I see - I was already doing this for r/with-let!

parentheian21:02:50

oh what a reflief to be free of the squiggly nightmare

parentheian21:02:28

now I just have to figure out how to get it to be ok with a macro that takes a vector of symbols but I am sure what you linked to probably points in that direction

parentheian21:02:00

because I really dont like living in the land of squiggly underlines because I have such macros

parentheian21:02:47

but thats 4 years old so I was hoping there was like meta data or some other convention