Skip to content
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

Include dispatch-val in analysis of defmethod #1716

Closed
mainej opened this issue Jun 8, 2022 · 1 comment · Fixed by #1754
Closed

Include dispatch-val in analysis of defmethod #1716

mainej opened this issue Jun 8, 2022 · 1 comment · Fixed by #1754
Projects

Comments

@mainej
Copy link
Contributor

mainej commented Jun 8, 2022

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Description

Occasionally it would be useful if the analysis included the dispatch-val of a defmethod. It's possible this could be used for #1682. Also see here for a case where clojure-lsp could use this additional analysis.

Describe the solution you'd like

Include the dispatch-val in the analysis. That value is always in the same spot, so the analysis shouldn't be too hard.

To consider:

  1. Should this be opt-in, via the :analysis config?
  2. dispatch-vals can be arbitrarily large. Is there a problem with size?
  3. dispatch-vals can contain references to other locals and vars. Probably best to include the raw sexpr, not any transformation.

Describe alternatives you've considered

Use other tools, like rewrite-clj, to find the dispatch-val.

@borkdude borkdude added this to Needs triage in clj-kondo via automation Jun 9, 2022
@borkdude borkdude moved this from Needs triage to Medium priority (new / enhance) in clj-kondo Jun 9, 2022
@mainej
Copy link
Contributor Author

mainej commented Jul 20, 2022

Note that :dispatch-val is a sexp. Would you rather have it be a string @borkdude? (If so, it should probably be transformed with pr-str, not str, so it's easier to identify string dispatch vals.)

clj-kondo automation moved this from Medium priority (new / enhance) to Done Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
clj-kondo
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant