We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug clojure-lsp incorrectly identifies definterface methods as unused.
definterface
To Reproduce Steps to reproduce the behavior:
Create foo_test.clj:
foo_test.clj
(ns foo-test) (definterface Foo (bar [x])) (let [f (reify Foo (bar [_ x] x))] (.bar f 5))
It can be evaluated to verify that bar was defined and used in the snippet. clojure-lsp diagnostics would show that (bar [x]) is unused.
bar
clojure-lsp diagnostics
(bar [x])
Expected behavior It should not report these methods as unused.
The text was updated successfully, but these errors were encountered:
@borkdude do you see anything that clj-kondo could help here? the problem is that the only analysis for .bar is a instance-invocation:
.bar
instance-invocation
{:method-name "bar", :uri "...", :bucket :instance-invocations}
So I can't find a way to relate that bar with the bar from the definterface 🤔
Sorry, something went wrong.
I don't think it makes sense to flag foo as an unused var even when .foo is not called since reify uses the whole interface.
foo
.foo
hum, good point, I think it makes sense to ignore all methods in the unused-public-var linter and consider only the Foo if it's being used or not
Foo
0137d32
No branches or pull requests
Describe the bug
clojure-lsp incorrectly identifies
definterface
methods as unused.To Reproduce
Steps to reproduce the behavior:
Create
foo_test.clj
:It can be evaluated to verify that
bar
was defined and used in the snippet.clojure-lsp diagnostics
would show that(bar [x])
is unused.Expected behavior
It should not report these methods as unused.
The text was updated successfully, but these errors were encountered: