-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Highlight tests fail with >=tree-sitter 0.21 #83
Comments
I've made a bit of progress and got most of the tests to pass. It looks like the changelog entry is accurate. Here is a patch for highlight.scm that makes all tests but functions.gleam pass (just shuffling things around). diff --git a/queries/highlights.scm b/queries/highlights.scm
index 20f809f..0365244 100644
--- a/queries/highlights.scm
+++ b/queries/highlights.scm
@@ -7,22 +7,11 @@
(constant
name: (identifier) @constant)
-; Modules
-(module) @module
-(import alias: (identifier) @module)
-(remote_type_identifier
- module: (identifier) @module)
-(remote_constructor_name
- module: (identifier) @module)
-((field_access
- record: (identifier) @module
- field: (label) @function)
- (#is-not? local))
+; Variables
+(identifier) @variable
+(discard) @comment.unused
; Functions
-(unqualified_import (identifier) @function)
-(unqualified_import "type" (type_identifier) @type)
-(unqualified_import (type_identifier) @constructor)
(function
name: (identifier) @function)
(external_function
@@ -37,6 +26,18 @@
right: (identifier) @function)
(#is-not? local))
+; Modules
+(module) @module
+(import alias: (identifier) @module)
+(remote_type_identifier
+ module: (identifier) @module)
+(remote_constructor_name
+ module: (identifier) @module)
+((field_access
+ record: (identifier) @module
+ field: (label) @function)
+ (#is-not? local))
+
; "Properties"
; Assumed to be intended to refer to a name for a field; something that comes
; before ":" or after "."
@@ -59,12 +60,17 @@
; Data constructors
(constructor_name) @constructor
+; Import
+(unqualified_import (identifier) @function)
+(unqualified_import (type_identifier) @constructor)
+(unqualified_import "type" (type_identifier) @type)
+
; Literals
(string) @string
+(escape_sequence) @string.escape
((escape_sequence) @warning
; Deprecated in v0.33.0-rc2:
(#eq? @warning "\\e"))
-(escape_sequence) @string.escape
(bit_string_segment_option) @function.builtin
(integer) @number
(float) @number
@@ -75,10 +81,6 @@
((identifier) @error
(#match? @error "^(auto|delegate|derive|else|implement|macro|test|echo)$"))
-; Variables
-(identifier) @variable
-(discard) @comment.unused
-
; Keywords
[
(visibility_modifier) ; "pub"
@@ -99,12 +101,6 @@
"use"
] @keyword
-; Operators
-(binary_expression
- operator: _ @operator)
-(boolean_negation "!" @operator)
-(integer_negation "-" @operator)
-
; Punctuation
[
"("
@@ -128,3 +124,9 @@
"-"
"<-"
] @punctuation.delimiter
+
+; Operators
+(binary_expression
+ operator: _ @operator)
+(boolean_negation "!" @operator)
+(integer_negation "-" @operator) The failure I'm stuck with is that function names in calls are being highlighted as property accesses, e.g. this test:
|
It looks like the |
With
tree-sitter
0.20.6 as used by the CI, the tests all pass for me. However when upgrading to tree-sitter 0.21.0 and later, some of the highlight tests fail.There's something called out in the changelog of tree-sitter 0.21 which might be the issue:
The text was updated successfully, but these errors were encountered: