Fork me on GitHub
#lsp
<
2022-01-11
>
lispers-anonymous15:01:34

When using clojure-lsp in emacs, if I have an unused function then lsp will show me a clojure-lsp/unused-public-var warning. Is there a way to also show this warning for unused re-frame events and subscriptions? I can see when one of these re-frame handlers has 0 references, but clojure-lsp doesn't register that as any kind of warning.

ericdallo15:01:17

I doubled checked clojure-lsp code and we didn't exclude re-frame handlers or subscriptions, it should warn as unused

ericdallo15:01:08

oh, I think re-frame is considered a :keyword not a :var-definition on kondo-eyes, I think that's the reason for we don't check for unused public vars for reg-*

lispers-anonymous15:01:46

That would make sense, I guess the functionality I want would need to be enabled in clj-kondo somehow, probably with a code change

ericdallo15:01:50

what I think it makes sense is to fix clojure-lsp to consider those keywords as var definitions and then clojure-lsp will warn by default the unused-public-var like it does for other definitions, if user doesn't want that it can still be changed via the linters clj-kondo config normally

ericdallo15:01:08

could you open a issue please?