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

Allow disabling external keyword exclusions #1814

Closed
julienvincent opened this issue May 13, 2024 · 1 comment
Closed

Allow disabling external keyword exclusions #1814

julienvincent opened this issue May 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@julienvincent
Copy link

In version 2023.10.30-16.25.41 keywords that are considered external to the project are not included in static analysis.

As an example here are two very common scenarios for me:

  • I have projects with .edn config files that are outside of the configured project class-path. The .edn files do not get any syntax highlighting.

  • I spend a lot of time reading code that lives in external dependencies. When I use something like go-to-definition on a var that resolves to an external dependency then I have no syntax highlighting for the keywords defined in the dependency. This makes that experience a lot worse.

This frustrates me enough that I have stayed on version 2023.08.06-00.28.06 - but this obviously means I lose out on all the other improvements being made in the project.

I would rather have the syntax highlighting than improved performance. Could this behaviour of excluding highlighting for external keywords be made configurable? I would rather leave it on.

@julienvincent julienvincent added the enhancement New feature or request label May 13, 2024
@julienvincent
Copy link
Author

For any future readers - I have solved this problem for myself by overriding the treesitter highlight queries defined by the default clojure grammar.

This is my override which is based on: https://github.com/sogaiu/tree-sitter-clojure/blob/f4236d4da8aa92bc105d9c118746474c608e6af7/queries/highlights.scm

(kwd_name) @keyword
(kwd_ns) @namespace

(num_lit) @number

[
  (char_lit)
  (str_lit)
] @string

[
 (bool_lit)
 (nil_lit)
] @constant.builtin

;; Comments

(comment) @comment

;; Treat quasiquotation as operators for the purpose of highlighting.

[
 "'"
 "`"
 "~"
 "@"
 "~@"
] @operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant