Fix malformed predicates in highlighting queries

pull/9329/head
Michael Davis 8 months ago committed by Blaž Hrastnik
parent 38af99f05f
commit 4ffe993533

@ -2,7 +2,7 @@
(call_expression (call_expression
function: (identifier) @function.builtin 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 (call_expression
function: (identifier) @function) function: (identifier) @function)
@ -19,7 +19,7 @@
name: (identifier) @type.parameter)) name: (identifier) @type.parameter))
((type_identifier) @type.builtin ((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 (type_identifier) @type

@ -231,7 +231,7 @@
] @keyword ] @keyword
; TODO: fix this ; TODO: fix this
((identifier) @keyword (match? @keyword "global|local")) ((identifier) @keyword (#match? @keyword "global|local"))
; --------- ; ---------
; Operators ; Operators
@ -277,12 +277,12 @@
; SCREAMING_SNAKE_CASE ; SCREAMING_SNAKE_CASE
( (
(identifier) @constant (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) ; remaining identifiers that start with capital letters should be types (PascalCase)
( (
(identifier) @type (identifier) @type
(match? @type "^[A-Z]")) (#match? @type "^[A-Z]"))
; Field expressions are either module content or struct fields. ; Field expressions are either module content or struct fields.
; Module types and constants should already be captured, so this ; Module types and constants should already be captured, so this

@ -172,7 +172,7 @@
(clazz (identifier) @type) (clazz (identifier) @type)
(typeAlias (identifier) @type) (typeAlias (identifier) @type)
((identifier) @type ((identifier) @type
(match? @type "^[A-Z]")) (#match? @type "^[A-Z]"))
(typeArgumentList (typeArgumentList
"<" @punctuation.bracket "<" @punctuation.bracket

@ -18,7 +18,7 @@
( (
((methodCallExpr (identifier) @methodName (argumentList (slStringLiteral) @injection.content)) ((methodCallExpr (identifier) @methodName (argumentList (slStringLiteral) @injection.content))
(#set! injection.language "regex")) (#set! injection.language "regex"))
(eq? @methodName "Regex")) (#eq? @methodName "Regex"))
((lineComment) @injection.content ((lineComment) @injection.content
(#set! injection.language "comment")) (#set! injection.language "comment"))

@ -44,9 +44,9 @@
"@while" @keyword.control.repeat "@while" @keyword.control.repeat
((property_name) @variable ((property_name) @variable
(match? @variable "^--")) (#match? @variable "^--"))
((plain_value) @variable ((plain_value) @variable
(match? @variable "^--")) (#match? @variable "^--"))
(tag_name) @tag (tag_name) @tag
(universal_selector) @tag (universal_selector) @tag

Loading…
Cancel
Save