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

Racket: Mark all quoted symbols as @symbol #5376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion queries/racket/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

(regex) @string.regex

((string) @symbol (#has-ancestor? @symbol quote))

;; comment ;;

[(comment)
Expand All @@ -41,6 +43,8 @@
((symbol) @comment
(#lua-match? @comment "^#[cC][iIsS]$"))

((symbol) @symbol (#has-ancestor? @symbol quote))

;; extension ;;

(extension) @keyword
Expand All @@ -58,7 +62,7 @@

(list
.
(symbol) @function)
(symbol) @function (#not-has-ancestor? @function quote))
Copy link
Member

@amaanq amaanq Oct 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an fyi the ancestor functions are expensive - I'd pick one to use it on, and then another not - so ideally the later more-strict query using an ancestor predicate will override the looser former one, you can structure it how you'd like


;;------------------------------------------------------------------;;
;; Builtin highlights ;;
Expand Down