New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[analysis] Add defined-by on missing var definitions #1219
[analysis] Add defined-by on missing var definitions #1219
Conversation
@borkdude I don't know if that is going to work with hook var-defintions like |
@ericdallo So you wrote a hook for state-flow/defflow but after expansion it's linted as normal clojure.core/defn right? Is that the problem? Btw, some tests are failing. |
Fixed tests, sorry for that! @borkdude yes, and I just realized that the hook is using a how can we make that work? is there anything we can add to the hook to tell clj-kondo to use a different |
BTW, I think this PR should solve clojure-lsp/clojure-lsp#340 as well :) |
@ericdallo We could return an extra value in the hook response, |
@borkdude it makes sense, any tips how to implement that? |
@ericdallo We can maybe put it on the clj-kondo/src/clj_kondo/impl/analyzer.clj Line 1420 in 3f63419
|
That analyze-expression** is used by a lot of places and the places that |
@ericdallo My suggestion was to pass the |
@borkdude just tested your suggestion with the hook and it worked like a charm :) ...
{:node (with-meta new-node (meta node))
:defined-by 'state-flow.cljtest/defflow} And clojure-lsp got it correctly! |
@ericdallo Cool! Maybe add a test for it and then we can merge? |
Sure, should I create a test for the stateflow macro? |
Just capturing the behavior that hooks can return that |
e74c8f0
to
83f04b2
Compare
Finally fixed @borkdude! IMO we are good to go |
Fixes #1216
This should add the
:defined-by
with the full-qualified-symbol for allvar-definitions
.