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] A way to differ defmethod analysis from defmethod usages #1570
Comments
@borkdude Do you think my suggestion is valid? Can I open a PR following that idea? |
@ericdallo Sorry, it slipped off my radar. I think I'm going to have some minor things to change, but overall I think it's good to make a PR, if you don't mind changing some things after the fact. Else, I'm going to look at this more closely in the weekend, hopefully. |
No problem, take your time! |
@ericdallo Finally looked at this. I think Should we move the second case to a new bucket, since it's not really a var usage, but more like |
I see, it's not a defined-by indeed, I think the way is |
@ericdallo Or we could just add a key to the var usage's
|
Not sure, context sounds like something extra outside core clojure, but it could be my impression though |
Or maybe just another key |
Maybe the last one is the best option. A better name maybe: |
|
Yes. |
Thanks! |
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Is your feature request related to a problem? Please describe.
Related clojure-lsp/clojure-lsp#656.
I'd like to implement find implementations on multimethods, for that work I need a way to tell that a analysis element is a defmulti definition, a defmethod definition or a usage of a defmethod.
Code
Analysis output
you can see both
usage
anddefmethod
are the same.Describe the solution you'd like
I'd like a way to tell that one is defmethod and other is usage, the most simple solution would be to have a
defined-by
field with a valueclojure.core/defmethod
when from defmethod otherwise nilDescribe alternatives you've considered
@borkdude suggested having a separated
multimethod-impls
, that would work, but not sure multimethods are as complex as protocols/impls to have a separated bucket for them and since we already have the:defined-by
on var-definitions, that sounds like a good approach to me.Additional context
I can work in a PR when I find the time
The text was updated successfully, but these errors were encountered: