Skip to content

Commit

Permalink
tsq: Tune highlights to more closely match 24.07 release
Browse files Browse the repository at this point in the history
The changes in #12148 were a bit radical - this restores some
customizations we had like using "label" for captures and not
highlighting the '#' or '?'/'!' parts differently. Also the highlighting
for predicates we do (not) support has been restored.
  • Loading branch information
the-mikedavis committed Jan 2, 2025
1 parent 38e8382 commit e0bccd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
23 changes: 8 additions & 15 deletions runtime/queries/tsq/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@

"_" @constant

[
"@"
"#"
] @punctuation.special

":" @punctuation.delimiter

[
Expand All @@ -27,8 +22,6 @@

"." @operator

(predicate_type) @punctuation.special

(quantifier) @operator

(comment) @comment
Expand All @@ -41,16 +34,16 @@
name: (identifier) @variable.other.member)

(named_node
name: (identifier) @variable)

(predicate
name: (identifier) @function)
name: (identifier) @tag)

(anonymous_node
(string) @string)
((predicate
"#" @function.builtin
name: (identifier) @function.builtin @_name
type: (predicate_type) @function.builtin)
(#any-of? @_name "eq" "match" "any-of" "not-any-of" "is" "is-not" "not-same-line" "not-kind-eq" "set" "select-adjacent" "strip"))
(predicate name: (identifier) @error)

(capture
(identifier) @type)
(capture) @label

(escape_sequence) @constant.character.escape

Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/tsq/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
name: (identifier) @_name
parameters:
(parameters
(string) @injection.content))
(string (string_content) @injection.content)))
(#any-of? @_name "match" "not-match")
(#set! injection.language "regex"))

0 comments on commit e0bccd2

Please sign in to comment.