Skip to content

Commit

Permalink
Fix malformed predicates in highlighting queries
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored and Vulpesx committed Jun 7, 2024
1 parent 309cd7c commit af5ac2c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions runtime/queries/go/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(call_expression
function: (identifier) @function.builtin
(match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))
(#match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))

(call_expression
function: (identifier) @function)
Expand All @@ -19,7 +19,7 @@
name: (identifier) @type.parameter))

((type_identifier) @type.builtin
(match? @type.builtin "^(any|bool|byte|comparable|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$"))
(#match? @type.builtin "^(any|bool|byte|comparable|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$"))

(type_identifier) @type

Expand Down
6 changes: 3 additions & 3 deletions runtime/queries/julia/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
] @keyword

; TODO: fix this
((identifier) @keyword (match? @keyword "global|local"))
((identifier) @keyword (#match? @keyword "global|local"))

; ---------
; Operators
Expand Down Expand Up @@ -277,12 +277,12 @@
; SCREAMING_SNAKE_CASE
(
(identifier) @constant
(match? @constant "^[A-Z][A-Z0-9_]*$"))
(#match? @constant "^[A-Z][A-Z0-9_]*$"))

; remaining identifiers that start with capital letters should be types (PascalCase)
(
(identifier) @type
(match? @type "^[A-Z]"))
(#match? @type "^[A-Z]"))

; Field expressions are either module content or struct fields.
; Module types and constants should already be captured, so this
Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/pkl/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
(clazz (identifier) @type)
(typeAlias (identifier) @type)
((identifier) @type
(match? @type "^[A-Z]"))
(#match? @type "^[A-Z]"))

(typeArgumentList
"<" @punctuation.bracket
Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/pkl/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(
((methodCallExpr (identifier) @methodName (argumentList (slStringLiteral) @injection.content))
(#set! injection.language "regex"))
(eq? @methodName "Regex"))
(#eq? @methodName "Regex"))

((lineComment) @injection.content
(#set! injection.language "comment"))
Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/scss/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"@while" @keyword.control.repeat

((property_name) @variable
(match? @variable "^--"))
(#match? @variable "^--"))
((plain_value) @variable
(match? @variable "^--"))
(#match? @variable "^--"))

(tag_name) @tag
(universal_selector) @tag
Expand Down

0 comments on commit af5ac2c

Please sign in to comment.