diff --git a/languages.toml b/languages.toml index 9da454a08..f8b2d579d 100644 --- a/languages.toml +++ b/languages.toml @@ -707,7 +707,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "tsq" -source = { git = "https://github.com/the-mikedavis/tree-sitter-tsq", rev = "ea68fc2b571ca1c8f70936855130c380f518ff35" } +source = { git = "https://github.com/the-mikedavis/tree-sitter-tsq", rev = "48b5e9f82ae0a4727201626f33a17f69f8e0ff86" } [[language]] name = "cmake" diff --git a/runtime/queries/tsq/highlights.scm b/runtime/queries/tsq/highlights.scm index fd5917fb1..c655b994f 100644 --- a/runtime/queries/tsq/highlights.scm +++ b/runtime/queries/tsq/highlights.scm @@ -6,7 +6,7 @@ ; highlight inheritance comments ((query . (comment) @keyword.directive) - (#match? @keyword.directive "^;\ +inherits *:")) + (#match? @keyword.directive "^; +inherits *:")) [ "(" @@ -40,8 +40,11 @@ (capture) @label -(predicate_name) @function +((predicate_name) @function + (#match? @function "^#(eq\\?|match\\?|is\\?|is-not\\?|not-same-line\\?|not-kind-eq\\?|set!|select-adjacent!|strip!)$")) +(predicate_name) @error (escape_sequence) @constant.character.escape -(node_name) @variable +(node_name) @tag +(variable) @variable diff --git a/runtime/queries/tsq/injections.scm b/runtime/queries/tsq/injections.scm index 321c90add..644045570 100644 --- a/runtime/queries/tsq/injections.scm +++ b/runtime/queries/tsq/injections.scm @@ -1,2 +1,8 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((predicate + (predicate_name) @_predicate + (string) @injection.content) + (#eq? @_predicate "#match?") + (#set! injection.language "regex"))