-
-
Notifications
You must be signed in to change notification settings - Fork 843
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
base: master
Are you sure you want to change the base?
Conversation
5422aa4
to
346c07e
Compare
@Lazerbeak12345 Thanks for checking! I've changed the PR to exclude changes to the Strings, now they will look more like in DrRacket. |
Yep, I didn't change the highlighting of other primitive types, nut in neovim they are already highlighted as symbols regardless of whether they are quoted or not. |
@@ -58,7 +62,7 @@ | |||
|
|||
(list | |||
. | |||
(symbol) @function) | |||
(symbol) @function (#not-has-ancestor? @function quote)) |
There was a problem hiding this comment.
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
I've noticed that Neovim does not distinguish quoted and unquoted lists and highlights them the same.
For example,
(a b c)
is a list that can be evaluated as a function call toa
withb
andc
as arguments. But'(a b c)
is a list of the symbolsa
,b
, andc
, not evaluated, just data.How it looks now:
How it will look with this PR:
As you may note, this PR doesn't fix highlighting inside
(quote (a b c))
- this requires a minor change to the racket treesitter parser and will be implemented separately.Important disclaimer: I am not a Racket expert, so it's possible that I understand
quote
semantics incorrectly. I've tried to look at how other editors highlight such code (Emacs, VS Code, Sublime Text, Helix), but they either do not highlight quotes at all, or highlight them approximately the same as Neovim now.