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

Support derived-location on analysis generated by hooks #1845

Closed
1 of 4 tasks
ericdallo opened this issue Oct 19, 2022 · 0 comments
Closed
1 of 4 tasks

Support derived-location on analysis generated by hooks #1845

ericdallo opened this issue Oct 19, 2022 · 0 comments
Projects

Comments

@ericdallo
Copy link
Member

ericdallo commented Oct 19, 2022

Is your feature request related to a problem? Please describe.

ATM clojure-lsp filter out analysis elements that has nil location here, after https://github.com/clj-kondo/clj-kondo/pull/1836/files, clj-kondo started to return non-nil locations for generated code provided by hooks, that's ok for fix findings having locations but make clojure-lsp think that code exists but in fact it's auto generated causing weird behaviors on highlighting, semantic-tokens and others for some custom-hooks, like state-flow

example:

Before:
on-flow-old on-defflow-old

After:
on-flow-new on-defflow-new

Describe the solution you'd like

@borkdude suggested: have a new field like derived-location and clojure-lsp ignore those analysis.

Describe alternatives you've considered

Try to fix the hook, but I don't think it's possible

Additional context

@borkdude started a branch generated-location which partially fixes it ATM but there are still missing analysis to be considered:

  • var-definitions
  • var-usages (it seems there are some missing yet)
  • keywords
  • locals

I think those are the ones interested for hooks, not sure If I missed any other

@borkdude borkdude added this to Needs triage in clj-kondo via automation Oct 19, 2022
@borkdude borkdude moved this from Needs triage to High priority (next release) in clj-kondo Oct 19, 2022
clj-kondo automation moved this from High priority (next release) to Done Oct 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

No branches or pull requests

1 participant