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

Fix null and boolean constants in tree-sitter-nix highlights queries #1428

Merged

Conversation

Philipp-M
Copy link
Contributor

null and boolean literals were previously detected as variable.builtin. This PR fixes this and detects these as:
constant.builtin and constant.builtin.boolean respectively

@@ -33,6 +33,11 @@

(uri) @string.special.uri

; boolean
((identifier) @constant.builtin.boolean (#match? @constant.builtin.boolean "^(true|false)$")) @constant.builtin.boolean
Copy link
Member

Choose a reason for hiding this comment

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

Should this just be ["true" "false"] @constant.builtin.boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this doesn't work as true and false is recognized as identifier:
thread 'main' panicked at 'Query error at 37:3. Invalid node type true', helix-core/src/syntax.rs:207:29

@archseer archseer merged commit 66afbc9 into helix-editor:master Jan 6, 2022
@Philipp-M Philipp-M deleted the fix-nix-highlights-constants branch January 7, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants