From 972213192636e8c57a503fd5e232ee12d29efd77 Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Tue, 9 Dec 2025 00:09:48 +0000 Subject: [PATCH 1/2] chore(ci): check highlights `*.scm` file changes --- src/textual/tree-sitter/highlights/bash.scm | 56 --- src/textual/tree-sitter/highlights/css.scm | 91 ---- src/textual/tree-sitter/highlights/go.scm | 123 ----- src/textual/tree-sitter/highlights/html.scm | 25 - src/textual/tree-sitter/highlights/java.scm | 142 ------ .../tree-sitter/highlights/javascript.scm | 204 -------- src/textual/tree-sitter/highlights/json.scm | 32 -- .../tree-sitter/highlights/markdown.scm | 51 -- src/textual/tree-sitter/highlights/python.scm | 313 ------------ src/textual/tree-sitter/highlights/regex.scm | 50 -- src/textual/tree-sitter/highlights/rust.scm | 155 ------ src/textual/tree-sitter/highlights/sql.scm | 444 ------------------ src/textual/tree-sitter/highlights/toml.scm | 36 -- src/textual/tree-sitter/highlights/xml.scm | 168 ------- src/textual/tree-sitter/highlights/yaml.scm | 53 --- 15 files changed, 1943 deletions(-) delete mode 100644 src/textual/tree-sitter/highlights/bash.scm delete mode 100644 src/textual/tree-sitter/highlights/css.scm delete mode 100644 src/textual/tree-sitter/highlights/go.scm delete mode 100644 src/textual/tree-sitter/highlights/html.scm delete mode 100644 src/textual/tree-sitter/highlights/java.scm delete mode 100644 src/textual/tree-sitter/highlights/javascript.scm delete mode 100644 src/textual/tree-sitter/highlights/json.scm delete mode 100644 src/textual/tree-sitter/highlights/markdown.scm delete mode 100644 src/textual/tree-sitter/highlights/python.scm delete mode 100644 src/textual/tree-sitter/highlights/regex.scm delete mode 100644 src/textual/tree-sitter/highlights/rust.scm delete mode 100644 src/textual/tree-sitter/highlights/sql.scm delete mode 100644 src/textual/tree-sitter/highlights/toml.scm delete mode 100644 src/textual/tree-sitter/highlights/xml.scm delete mode 100644 src/textual/tree-sitter/highlights/yaml.scm diff --git a/src/textual/tree-sitter/highlights/bash.scm b/src/textual/tree-sitter/highlights/bash.scm deleted file mode 100644 index f33a7c2d3a..0000000000 --- a/src/textual/tree-sitter/highlights/bash.scm +++ /dev/null @@ -1,56 +0,0 @@ -[ - (string) - (raw_string) - (heredoc_body) - (heredoc_start) -] @string - -(command_name) @function - -(variable_name) @property - -[ - "case" - "do" - "done" - "elif" - "else" - "esac" - "export" - "fi" - "for" - "function" - "if" - "in" - "select" - "then" - "unset" - "until" - "while" -] @keyword - -(comment) @comment - -(function_definition name: (word) @function) - -(file_descriptor) @number - -[ - (command_substitution) - (process_substitution) - (expansion) -]@embedded - -[ - "$" - "&&" - ">" - ">>" - "<" - "|" -] @operator - -( - (command (_) @constant) - (#match? @constant "^-") -) diff --git a/src/textual/tree-sitter/highlights/css.scm b/src/textual/tree-sitter/highlights/css.scm deleted file mode 100644 index 61ad9c412e..0000000000 --- a/src/textual/tree-sitter/highlights/css.scm +++ /dev/null @@ -1,91 +0,0 @@ -[ - "@media" - "@charset" - "@namespace" - "@supports" - "@keyframes" - (at_keyword) - (to) - (from) - ] @keyword - -"@import" @include - -(comment) @comment @spell - -[ - (tag_name) - (nesting_selector) - (universal_selector) - ] @type - -(function_name) @function - -[ - "~" - ">" - "+" - "-" - "*" - "/" - "=" - "^=" - "|=" - "~=" - "$=" - "*=" - "and" - "or" - "not" - "only" - ] @operator - -(important) @type.qualifier - -(attribute_selector (plain_value) @string) -(pseudo_element_selector "::" (tag_name) @property) -(pseudo_class_selector (class_name) @property) - -[ - (class_name) - (id_name) - (property_name) - (feature_name) - (attribute_name) - ] @css.property - -(namespace_name) @namespace - -((property_name) @type.definition - (#match? @type.definition "^[-][-]")) -((plain_value) @type - (#match? @type "^[-][-]")) - -[ - (string_value) - (color_value) - (unit) - ] @string - -[ - (integer_value) - (float_value) - ] @number - -[ - "#" - "," - "." - ":" - "::" - ";" - ] @punctuation.delimiter - -[ - "{" - ")" - "(" - "}" - ] @punctuation.bracket - -(ERROR) @error diff --git a/src/textual/tree-sitter/highlights/go.scm b/src/textual/tree-sitter/highlights/go.scm deleted file mode 100644 index 7e1d625272..0000000000 --- a/src/textual/tree-sitter/highlights/go.scm +++ /dev/null @@ -1,123 +0,0 @@ -; Function calls - -(call_expression - function: (identifier) @function.builtin - (.match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$")) - -(call_expression - function: (identifier) @function) - -(call_expression - function: (selector_expression - field: (field_identifier) @function.method)) - -; Function definitions - -(function_declaration - name: (identifier) @function) - -(method_declaration - name: (field_identifier) @function.method) - -; Identifiers - -(type_identifier) @type -(field_identifier) @property -(identifier) @variable - -; Operators - -[ - "--" - "-" - "-=" - ":=" - "!" - "!=" - "..." - "*" - "*" - "*=" - "/" - "/=" - "&" - "&&" - "&=" - "%" - "%=" - "^" - "^=" - "+" - "++" - "+=" - "<-" - "<" - "<<" - "<<=" - "<=" - "=" - "==" - ">" - ">=" - ">>" - ">>=" - "|" - "|=" - "||" - "~" -] @operator - -; Keywords - -[ - "break" - "case" - "chan" - "const" - "continue" - "default" - "defer" - "else" - "fallthrough" - "for" - "func" - "go" - "goto" - "if" - "import" - "interface" - "map" - "package" - "range" - "return" - "select" - "struct" - "switch" - "type" - "var" -] @keyword - -; Literals - -[ - (interpreted_string_literal) - (raw_string_literal) - (rune_literal) -] @string - -(escape_sequence) @escape - -[ - (int_literal) - (float_literal) - (imaginary_literal) -] @number - -[ - (true) - (false) - (nil) - (iota) -] @constant.builtin - -(comment) @comment diff --git a/src/textual/tree-sitter/highlights/html.scm b/src/textual/tree-sitter/highlights/html.scm deleted file mode 100644 index 41c83ce0d8..0000000000 --- a/src/textual/tree-sitter/highlights/html.scm +++ /dev/null @@ -1,25 +0,0 @@ -(tag_name) @tag -(erroneous_end_tag_name) @html.end_tag_error -(comment) @comment -(attribute_name) @tag.attribute -(attribute - (quoted_attribute_value) @string) -(text) @text @spell - -((attribute - (attribute_name) @_attr - (quoted_attribute_value (attribute_value) @text.uri)) - (#any-of? @_attr "href" "src")) - -[ - "<" - ">" - "" -] @tag.delimiter - -"=" @operator - -(doctype) @constant - -"" - ">" - ">=" - ">>" - ">>=" - ">>>" - ">>>=" - "~" - "^" - "&" - "|" - "^=" - "&=" - "|=" - "&&" - "||" - "??" - "&&=" - "||=" - "??=" -] @operator - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -(template_substitution - "${" @punctuation.special - "}" @punctuation.special) @embedded - -[ - "as" - "async" - "await" - "break" - "case" - "catch" - "class" - "const" - "continue" - "debugger" - "default" - "delete" - "do" - "else" - "export" - "extends" - "finally" - "for" - "from" - "function" - "get" - "if" - "import" - "in" - "instanceof" - "let" - "new" - "of" - "return" - "set" - "static" - "switch" - "target" - "throw" - "try" - "typeof" - "var" - "void" - "while" - "with" - "yield" -] @keyword diff --git a/src/textual/tree-sitter/highlights/json.scm b/src/textual/tree-sitter/highlights/json.scm deleted file mode 100644 index c23e7b3ce9..0000000000 --- a/src/textual/tree-sitter/highlights/json.scm +++ /dev/null @@ -1,32 +0,0 @@ -[ - (true) - (false) -] @boolean - -(null) @json.null - -(number) @number - -(pair key: (string) @json.label) -(pair value: (string) @string) - -(array (string) @string) - -(string_content) @spell - -(ERROR) @json.error - -["," ":"] @punctuation.delimiter - -[ - "[" "]" - "{" "}" -] @punctuation.bracket - -(("\"" @conceal) - (#set! conceal "")) - -(escape_sequence) @string.escape -((escape_sequence) @conceal - (#eq? @conceal "\\\"") - (#set! conceal "\"")) diff --git a/src/textual/tree-sitter/highlights/markdown.scm b/src/textual/tree-sitter/highlights/markdown.scm deleted file mode 100644 index 563c5138f5..0000000000 --- a/src/textual/tree-sitter/highlights/markdown.scm +++ /dev/null @@ -1,51 +0,0 @@ -(atx_heading (inline) @heading) -(setext_heading (paragraph) @heading) - -[ - (atx_h1_marker) - (atx_h2_marker) - (atx_h3_marker) - (atx_h4_marker) - (atx_h5_marker) - (atx_h6_marker) - (setext_h1_underline) - (setext_h2_underline) -] @heading.marker - -[ - (link_title) - (indented_code_block) - (fenced_code_block) -] @text.literal - -[ - (fenced_code_block_delimiter) -] @punctuation.delimiter - -(code_fence_content) @none - -[ - (link_destination) -] @link.uri - -[ - (link_label) -] @link.label - -[ - (list_marker_plus) - (list_marker_minus) - (list_marker_star) - (list_marker_dot) - (list_marker_parenthesis) - (thematic_break) -] @list.marker - -[ - (block_continuation) - (block_quote_marker) -] @punctuation.special - -[ - (backslash_escape) -] @string.escape diff --git a/src/textual/tree-sitter/highlights/python.scm b/src/textual/tree-sitter/highlights/python.scm deleted file mode 100644 index 3e7381b813..0000000000 --- a/src/textual/tree-sitter/highlights/python.scm +++ /dev/null @@ -1,313 +0,0 @@ -;; From tree-sitter-python licensed under MIT License -; Copyright (c) 2016 Max Brunsfeld -; Adapted for Textual from: -; https://github.com/nvim-treesitter/nvim-treesitter/blob/f95ffd09ed35880c3a46ad2b968df361fa592a76/queries/python/highlights.scm - -; Variables -(identifier) @variable - -; Reset highlighting in f-string interpolations -(interpolation) @none - -;; Identifier naming conventions -((identifier) @type - (#match? @type "^[A-Z].*[a-z]")) -((identifier) @constant - (#match? @constant "^[A-Z][A-Z_0-9]*$")) - -((attribute - attribute: (identifier) @field) - (#match? @field "^([A-Z])@!.*$")) - -((identifier) @type.builtin - (#any-of? @type.builtin - ;; https://docs.python.org/3/library/exceptions.html - "BaseException" "Exception" "ArithmeticError" "BufferError" "LookupError" "AssertionError" "AttributeError" - "EOFError" "FloatingPointError" "GeneratorExit" "ImportError" "ModuleNotFoundError" "IndexError" "KeyError" - "KeyboardInterrupt" "MemoryError" "NameError" "NotImplementedError" "OSError" "OverflowError" "RecursionError" - "ReferenceError" "RuntimeError" "StopIteration" "StopAsyncIteration" "SyntaxError" "IndentationError" "TabError" - "SystemError" "SystemExit" "TypeError" "UnboundLocalError" "UnicodeError" "UnicodeEncodeError" "UnicodeDecodeError" - "UnicodeTranslateError" "ValueError" "ZeroDivisionError" "EnvironmentError" "IOError" "WindowsError" - "BlockingIOError" "ChildProcessError" "ConnectionError" "BrokenPipeError" "ConnectionAbortedError" - "ConnectionRefusedError" "ConnectionResetError" "FileExistsError" "FileNotFoundError" "InterruptedError" - "IsADirectoryError" "NotADirectoryError" "PermissionError" "ProcessLookupError" "TimeoutError" "Warning" - "UserWarning" "DeprecationWarning" "PendingDeprecationWarning" "SyntaxWarning" "RuntimeWarning" - "FutureWarning" "ImportWarning" "UnicodeWarning" "BytesWarning" "ResourceWarning" - ;; https://docs.python.org/3/library/stdtypes.html - "bool" "int" "float" "complex" "list" "tuple" "range" "str" - "bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type")) - -((assignment - left: (identifier) @type.definition - (type (identifier) @_annotation)) - (#eq? @_annotation "TypeAlias")) - -((assignment - left: (identifier) @type.definition - right: (call - function: (identifier) @_func)) - (#any-of? @_func "TypeVar" "NewType")) - -; Function calls - -(call - function: (identifier) @function.call) - -(call - function: (attribute - attribute: (identifier) @method.call)) - -((call - function: (identifier) @constructor) - (#match? @constructor "^[A-Z]")) - -((call - function: (attribute - attribute: (identifier) @constructor)) - (#match? @constructor "^[A-Z]")) - -;; Decorators - -((decorator "@" @attribute) - (#set! "priority" 101)) - -(decorator - (identifier) @attribute) -(decorator - (attribute - attribute: (identifier) @attribute)) -(decorator - (call (identifier) @attribute)) -(decorator - (call (attribute - attribute: (identifier) @attribute))) - -((decorator - (identifier) @attribute.builtin) - (#any-of? @attribute.builtin "classmethod" "property")) - -;; Builtin functions - -((call - function: (identifier) @function.builtin) - (#any-of? @function.builtin - "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr" "classmethod" - "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" "filter" "float" "format" - "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id" "input" "int" "isinstance" "issubclass" - "iter" "len" "list" "locals" "map" "max" "memoryview" "min" "next" "object" "oct" "open" "ord" "pow" - "print" "property" "range" "repr" "reversed" "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" - "sum" "super" "tuple" "type" "vars" "zip" "__import__")) - -;; Function definitions - -(function_definition - name: (identifier) @function) - -(type (identifier) @type) -(type - (subscript - (identifier) @type)) ; type subscript: Tuple[int] - -((call - function: (identifier) @_isinstance - arguments: (argument_list - (_) - (identifier) @type)) - (#eq? @_isinstance "isinstance")) - -;; Normal parameters -(parameters - (identifier) @parameter) -;; Lambda parameters -(lambda_parameters - (identifier) @parameter) -(lambda_parameters - (tuple_pattern - (identifier) @parameter)) -; Default parameters -(keyword_argument - name: (identifier) @parameter) -; Naming parameters on call-site -(default_parameter - name: (identifier) @parameter) -(typed_parameter - (identifier) @parameter) -(typed_default_parameter - (identifier) @parameter) -; Variadic parameters *args, **kwargs -(parameters - (list_splat_pattern ; *args - (identifier) @parameter)) -(parameters - (dictionary_splat_pattern ; **kwargs - (identifier) @parameter)) - - -;; Literals - -(none) @constant.builtin -[(true) (false)] @boolean -((identifier) @variable.builtin - (#eq? @variable.builtin "self")) -((identifier) @variable.builtin - (#eq? @variable.builtin "cls")) - -(integer) @number -(float) @float - -(comment) @comment @spell - -((module . (comment) @preproc) - (#match? @preproc "^#!/")) - -(string) @string -(escape_sequence) @string.escape - -; doc-strings -(expression_statement (string) @spell) - -; Tokens - -[ - "-" - "-=" - ":=" - "!=" - "*" - "**" - "**=" - "*=" - "/" - "//" - "//=" - "/=" - "&" - "&=" - "%" - "%=" - "^" - "^=" - "+" - "+=" - "<" - "<<" - "<<=" - "<=" - "<>" - "=" - "==" - ">" - ">=" - ">>" - ">>=" - "@" - "@=" - "|" - "|=" - "~" - "->" -] @operator - -; Keywords -[ - "and" - "in" - "is" - "not" - "or" - "del" -] @keyword.operator - -[ - "def" - "lambda" -] @keyword.function - -[ - "assert" - "async" - "await" - "class" - "exec" - "global" - "nonlocal" - "pass" - "print" - "with" - "as" -] @keyword - -[ - "return" - "yield" -] @keyword.return -(yield "from" @keyword.return) - -(future_import_statement - "from" @include - "__future__" @constant.builtin) -(import_from_statement "from" @include) -"import" @include - -(aliased_import "as" @include) - -["if" "elif" "else" "match" "case"] @conditional - -["for" "while" "break" "continue"] @repeat - -[ - "try" - "except" - "raise" - "finally" -] @exception - -(raise_statement "from" @exception) - -(try_statement - (else_clause - "else" @exception)) - -["(" ")" "[" "]" "{" "}"] @punctuation.bracket - -(interpolation - "{" @punctuation.special - "}" @punctuation.special) - -["," "." ":" ";" (ellipsis)] @punctuation.delimiter - -;; Class definitions - -(class_definition name: (identifier) @type.class) - -(class_definition - body: (block - (function_definition - name: (identifier) @method))) - -(class_definition - superclasses: (argument_list - (identifier) @type)) - -((class_definition - body: (block - (expression_statement - (assignment - left: (identifier) @field)))) - (#match? @field "^([A-Z])@!.*$")) -((class_definition - body: (block - (expression_statement - (assignment - left: (_ - (identifier) @field))))) - (#match? @field "^([A-Z])@!.*$")) - -((class_definition - (block - (function_definition - name: (identifier) @constructor))) - (#any-of? @constructor "__new__" "__init__")) - -;; Error -(ERROR) @error diff --git a/src/textual/tree-sitter/highlights/regex.scm b/src/textual/tree-sitter/highlights/regex.scm deleted file mode 100644 index 8b653465b4..0000000000 --- a/src/textual/tree-sitter/highlights/regex.scm +++ /dev/null @@ -1,50 +0,0 @@ -[ - "(" - ")" - "(?" - "(?:" - "(?<" - ">" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -(group_name) @property - -[ - (identity_escape) - (control_letter_escape) - (character_class_escape) - (control_escape) - (start_assertion) - (end_assertion) - (boundary_assertion) - (non_boundary_assertion) -] @escape - -[ - "*" - "+" - "?" - "|" - "=" - "!" -] @operator - -(count_quantifier - [ - (decimal_digits) @number - "," @punctuation.delimiter - ]) - -(character_class - [ - "^" @operator - (class_range "-" @operator) - ]) - -(class_character) @constant.character - -(pattern_character) @string diff --git a/src/textual/tree-sitter/highlights/rust.scm b/src/textual/tree-sitter/highlights/rust.scm deleted file mode 100644 index c1556847b3..0000000000 --- a/src/textual/tree-sitter/highlights/rust.scm +++ /dev/null @@ -1,155 +0,0 @@ -; Identifier conventions - -; Assume all-caps names are constants -((identifier) @constant - (#match? @constant "^[A-Z][A-Z\\d_]+$'")) - -; Assume that uppercase names in paths are types -((scoped_identifier - path: (identifier) @type) - (#match? @type "^[A-Z]")) -((scoped_identifier - path: (scoped_identifier - name: (identifier) @type)) - (#match? @type "^[A-Z]")) -((scoped_type_identifier - path: (identifier) @type) - (#match? @type "^[A-Z]")) -((scoped_type_identifier - path: (scoped_identifier - name: (identifier) @type)) - (#match? @type "^[A-Z]")) - -; Assume other uppercase names are enum constructors -((identifier) @constructor - (#match? @constructor "^[A-Z]")) - -; Assume all qualified names in struct patterns are enum constructors. (They're -; either that, or struct names; highlighting both as constructors seems to be -; the less glaring choice of error, visually.) -(struct_pattern - type: (scoped_type_identifier - name: (type_identifier) @constructor)) - -; Function calls - -(call_expression - function: (identifier) @function) -(call_expression - function: (field_expression - field: (field_identifier) @function.method)) -(call_expression - function: (scoped_identifier - "::" - name: (identifier) @function)) - -(generic_function - function: (identifier) @function) -(generic_function - function: (scoped_identifier - name: (identifier) @function)) -(generic_function - function: (field_expression - field: (field_identifier) @function.method)) - -(macro_invocation - macro: (identifier) @function.macro - "!" @function.macro) - -; Function definitions - -(function_item (identifier) @function) -(function_signature_item (identifier) @function) - -; Other identifiers - -(type_identifier) @type -(primitive_type) @type.builtin -(field_identifier) @property - -(line_comment) @comment -(block_comment) @comment - -"(" @punctuation.bracket -")" @punctuation.bracket -"[" @punctuation.bracket -"]" @punctuation.bracket -"{" @punctuation.bracket -"}" @punctuation.bracket - -(type_arguments - "<" @punctuation.bracket - ">" @punctuation.bracket) -(type_parameters - "<" @punctuation.bracket - ">" @punctuation.bracket) - -"::" @punctuation.delimiter -":" @punctuation.delimiter -"." @punctuation.delimiter -"," @punctuation.delimiter -";" @punctuation.delimiter - -(parameter (identifier) @variable.parameter) - -(lifetime (identifier) @label) - -"as" @keyword -"async" @keyword -"await" @keyword -"break" @keyword -"const" @keyword -"continue" @keyword -"default" @keyword -"dyn" @keyword -"else" @keyword -"enum" @keyword -"extern" @keyword -"fn" @keyword -"for" @keyword -"if" @keyword -"impl" @keyword -"in" @keyword -"let" @keyword -"loop" @keyword -"macro_rules!" @keyword -"match" @keyword -"mod" @keyword -"move" @keyword -"pub" @keyword -"ref" @keyword -"return" @keyword -"static" @keyword -"struct" @keyword -"trait" @keyword -"type" @keyword -"union" @keyword -"unsafe" @keyword -"use" @keyword -"where" @keyword -"while" @keyword -(crate) @keyword -(mutable_specifier) @keyword -(use_list (self) @keyword) -(scoped_use_list (self) @keyword) -(scoped_identifier (self) @keyword) -(super) @keyword - -(self) @variable.builtin - -(char_literal) @string -(string_literal) @string -(raw_string_literal) @string - -(boolean_literal) @constant.builtin -(integer_literal) @constant.builtin -(float_literal) @constant.builtin - -(escape_sequence) @escape - -(attribute_item) @attribute -(inner_attribute_item) @attribute - -"*" @operator -"&" @operator -"'" @operator diff --git a/src/textual/tree-sitter/highlights/sql.scm b/src/textual/tree-sitter/highlights/sql.scm deleted file mode 100644 index fe4913026c..0000000000 --- a/src/textual/tree-sitter/highlights/sql.scm +++ /dev/null @@ -1,444 +0,0 @@ -(object_reference - name: (identifier) @type) - -(invocation - (object_reference - name: (identifier) @function.call)) - -[ - (keyword_gist) - (keyword_btree) - (keyword_hash) - (keyword_spgist) - (keyword_gin) - (keyword_brin) - (keyword_array) -] @function.call - -(relation - alias: (identifier) @variable) - -(field - name: (identifier) @field) - -(term - alias: (identifier) @variable) - -((term - value: (cast - name: (keyword_cast) @function.call - parameter: [(literal)]?))) - -(comment) @comment @spell -(marginalia) @comment - -((literal) @number - (#match? @number "^[-+]?%d+$")) - -((literal) @float - (#match? @float "^[-+]?%d*\.%d*$")) - -(literal) @string - -(parameter) @parameter - -[ - (keyword_true) - (keyword_false) -] @boolean - -[ - (keyword_asc) - (keyword_desc) - (keyword_terminated) - (keyword_escaped) - (keyword_unsigned) - (keyword_nulls) - (keyword_last) - (keyword_delimited) - (keyword_replication) - (keyword_auto_increment) - (keyword_default) - (keyword_collate) - (keyword_concurrently) - (keyword_engine) - (keyword_always) - (keyword_generated) - (keyword_preceding) - (keyword_following) - (keyword_first) - (keyword_current_timestamp) - (keyword_immutable) - (keyword_atomic) - (keyword_parallel) - (keyword_leakproof) - (keyword_safe) - (keyword_cost) - (keyword_strict) -] @attribute - -[ - (keyword_materialized) - (keyword_recursive) - (keyword_temp) - (keyword_temporary) - (keyword_unlogged) - (keyword_external) - (keyword_parquet) - (keyword_csv) - (keyword_rcfile) - (keyword_textfile) - (keyword_orc) - (keyword_avro) - (keyword_jsonfile) - (keyword_sequencefile) - (keyword_volatile) -] @storageclass - -[ - (keyword_case) - (keyword_when) - (keyword_then) - (keyword_else) -] @conditional - -[ - (keyword_select) - (keyword_from) - (keyword_where) - (keyword_index) - (keyword_join) - (keyword_primary) - (keyword_delete) - (keyword_create) - (keyword_show) - (keyword_insert) - (keyword_merge) - (keyword_distinct) - (keyword_replace) - (keyword_update) - (keyword_into) - (keyword_overwrite) - (keyword_matched) - (keyword_values) - (keyword_value) - (keyword_attribute) - (keyword_set) - (keyword_left) - (keyword_right) - (keyword_outer) - (keyword_inner) - (keyword_full) - (keyword_order) - (keyword_partition) - (keyword_group) - (keyword_with) - (keyword_without) - (keyword_as) - (keyword_having) - (keyword_limit) - (keyword_offset) - (keyword_table) - (keyword_tables) - (keyword_key) - (keyword_references) - (keyword_foreign) - (keyword_constraint) - (keyword_force) - (keyword_use) - (keyword_for) - (keyword_if) - (keyword_exists) - (keyword_column) - (keyword_columns) - (keyword_cross) - (keyword_lateral) - (keyword_natural) - (keyword_alter) - (keyword_drop) - (keyword_add) - (keyword_view) - (keyword_end) - (keyword_is) - (keyword_using) - (keyword_between) - (keyword_window) - (keyword_no) - (keyword_data) - (keyword_type) - (keyword_rename) - (keyword_to) - (keyword_schema) - (keyword_owner) - (keyword_authorization) - (keyword_all) - (keyword_any) - (keyword_some) - (keyword_returning) - (keyword_begin) - (keyword_commit) - (keyword_rollback) - (keyword_transaction) - (keyword_only) - (keyword_like) - (keyword_similar) - (keyword_over) - (keyword_change) - (keyword_modify) - (keyword_after) - (keyword_before) - (keyword_range) - (keyword_rows) - (keyword_groups) - (keyword_exclude) - (keyword_current) - (keyword_ties) - (keyword_others) - (keyword_zerofill) - (keyword_format) - (keyword_fields) - (keyword_row) - (keyword_sort) - (keyword_compute) - (keyword_comment) - (keyword_location) - (keyword_cached) - (keyword_uncached) - (keyword_lines) - (keyword_stored) - (keyword_virtual) - (keyword_partitioned) - (keyword_analyze) - (keyword_explain) - (keyword_verbose) - (keyword_truncate) - (keyword_rewrite) - (keyword_optimize) - (keyword_vacuum) - (keyword_cache) - (keyword_language) - (keyword_called) - (keyword_conflict) - (keyword_declare) - (keyword_filter) - (keyword_function) - (keyword_input) - (keyword_name) - (keyword_oid) - (keyword_oids) - (keyword_precision) - (keyword_regclass) - (keyword_regnamespace) - (keyword_regproc) - (keyword_regtype) - (keyword_restricted) - (keyword_return) - (keyword_returns) - (keyword_separator) - (keyword_setof) - (keyword_stable) - (keyword_support) - (keyword_tblproperties) - (keyword_trigger) - (keyword_unsafe) - (keyword_admin) - (keyword_connection) - (keyword_cycle) - (keyword_database) - (keyword_encrypted) - (keyword_increment) - (keyword_logged) - (keyword_none) - (keyword_owned) - (keyword_password) - (keyword_reset) - (keyword_role) - (keyword_sequence) - (keyword_start) - (keyword_restart) - (keyword_tablespace) - (keyword_until) - (keyword_user) - (keyword_valid) - (keyword_action) - (keyword_definer) - (keyword_invoker) - (keyword_security) - (keyword_extension) - (keyword_version) - (keyword_out) - (keyword_inout) - (keyword_variadic) - (keyword_ordinality) - (keyword_session) - (keyword_isolation) - (keyword_level) - (keyword_serializable) - (keyword_repeatable) - (keyword_read) - (keyword_write) - (keyword_committed) - (keyword_uncommitted) - (keyword_deferrable) - (keyword_names) - (keyword_zone) - (keyword_immediate) - (keyword_deferred) - (keyword_constraints) - (keyword_snapshot) - (keyword_characteristics) - (keyword_off) - (keyword_follows) - (keyword_precedes) - (keyword_each) - (keyword_instead) - (keyword_of) - (keyword_initially) - (keyword_old) - (keyword_new) - (keyword_referencing) - (keyword_statement) - (keyword_execute) - (keyword_procedure) - (keyword_copy) - (keyword_delimiter) - (keyword_encoding) - (keyword_escape) - (keyword_force_not_null) - (keyword_force_null) - (keyword_force_quote) - (keyword_freeze) - (keyword_header) - (keyword_match) - (keyword_program) - (keyword_quote) - (keyword_stdin) - (keyword_extended) - (keyword_main) - (keyword_plain) - (keyword_storage) - (keyword_compression) - (keyword_duplicate) -] @keyword - -[ - (keyword_restrict) - (keyword_unbounded) - (keyword_unique) - (keyword_cascade) - (keyword_delayed) - (keyword_high_priority) - (keyword_low_priority) - (keyword_ignore) - (keyword_nothing) - (keyword_check) - (keyword_option) - (keyword_local) - (keyword_cascaded) - (keyword_wait) - (keyword_nowait) - (keyword_metadata) - (keyword_incremental) - (keyword_bin_pack) - (keyword_noscan) - (keyword_stats) - (keyword_statistics) - (keyword_maxvalue) - (keyword_minvalue) -] @type.qualifier - -[ - (keyword_int) - (keyword_null) - (keyword_boolean) - (keyword_binary) - (keyword_varbinary) - (keyword_image) - (keyword_bit) - (keyword_inet) - (keyword_character) - (keyword_smallserial) - (keyword_serial) - (keyword_bigserial) - (keyword_smallint) - (keyword_mediumint) - (keyword_bigint) - (keyword_tinyint) - (keyword_decimal) - (keyword_float) - (keyword_double) - (keyword_numeric) - (keyword_real) - (double) - (keyword_money) - (keyword_smallmoney) - (keyword_char) - (keyword_nchar) - (keyword_varchar) - (keyword_nvarchar) - (keyword_varying) - (keyword_text) - (keyword_string) - (keyword_uuid) - (keyword_json) - (keyword_jsonb) - (keyword_xml) - (keyword_bytea) - (keyword_enum) - (keyword_date) - (keyword_datetime) - (keyword_time) - (keyword_datetime2) - (keyword_datetimeoffset) - (keyword_smalldatetime) - (keyword_timestamp) - (keyword_timestamptz) - (keyword_geometry) - (keyword_geography) - (keyword_box2d) - (keyword_box3d) - (keyword_interval) -] @type.builtin - -[ - (keyword_in) - (keyword_and) - (keyword_or) - (keyword_not) - (keyword_by) - (keyword_on) - (keyword_do) - (keyword_union) - (keyword_except) - (keyword_intersect) -] @keyword.operator - -[ - "+" - "-" - "*" - "/" - "%" - "^" - ":=" - "=" - "<" - "<=" - "!=" - ">=" - ">" - "<>" - (op_other) - (op_unary_other) -] @operator - -[ - "(" - ")" -] @punctuation.bracket - -[ - ";" - "," - "." -] @punctuation.delimiter diff --git a/src/textual/tree-sitter/highlights/toml.scm b/src/textual/tree-sitter/highlights/toml.scm deleted file mode 100644 index 58ba6eb2d3..0000000000 --- a/src/textual/tree-sitter/highlights/toml.scm +++ /dev/null @@ -1,36 +0,0 @@ -; Properties -;----------- - -(bare_key) @toml.type -(quoted_key) @string -(pair (bare_key)) @property - -; Literals -;--------- - -(boolean) @boolean -(comment) @comment -(string) @string -(integer) @number -(float) @float -(offset_date_time) @toml.datetime -(local_date_time) @toml.datetime -(local_date) @toml.datetime -(local_time) @toml.datetime - -; Punctuation -;------------ - -"." @punctuation.delimiter -"," @punctuation.delimiter - -"=" @operator - -"[" @punctuation.bracket -"]" @punctuation.bracket -"[[" @punctuation.bracket -"]]" @punctuation.bracket -"{" @punctuation.bracket -"}" @punctuation.bracket - -(ERROR) @toml.error diff --git a/src/textual/tree-sitter/highlights/xml.scm b/src/textual/tree-sitter/highlights/xml.scm deleted file mode 100644 index 9861eea178..0000000000 --- a/src/textual/tree-sitter/highlights/xml.scm +++ /dev/null @@ -1,168 +0,0 @@ -;; XML declaration - -"xml" @keyword - -[ "version" "encoding" "standalone" ] @property - -(EncName) @string.special - -(VersionNum) @number - -[ "yes" "no" ] @boolean - -;; Processing instructions - -(PI) @embedded - -(PI (PITarget) @keyword) - -;; Element declaration - -(elementdecl - "ELEMENT" @keyword - (Name) @tag) - -(contentspec - (_ (Name) @property)) - -"#PCDATA" @type.builtin - -[ "EMPTY" "ANY" ] @string.special.symbol - -[ "*" "?" "+" ] @operator - -;; Entity declaration - -(GEDecl - "ENTITY" @keyword - (Name) @constant) - -(GEDecl (EntityValue) @string) - -(NDataDecl - "NDATA" @keyword - (Name) @label) - -;; Parsed entity declaration - -(PEDecl - "ENTITY" @keyword - "%" @operator - (Name) @constant) - -(PEDecl (EntityValue) @string) - -;; Notation declaration - -(NotationDecl - "NOTATION" @keyword - (Name) @constant) - -(NotationDecl - (ExternalID - (SystemLiteral (URI) @string.special))) - -;; Attlist declaration - -(AttlistDecl - "ATTLIST" @keyword - (Name) @tag) - -(AttDef (Name) @property) - -(AttDef (Enumeration (Nmtoken) @string)) - -(DefaultDecl (AttValue) @string) - -[ - (StringType) - (TokenizedType) -] @type.builtin - -(NotationType "NOTATION" @type.builtin) - -[ - "#REQUIRED" - "#IMPLIED" - "#FIXED" -] @attribute - -;; Entities - -(EntityRef) @constant - -((EntityRef) @constant.builtin - (#any-of? @constant.builtin - "&" "<" ">" """ "'")) - -(CharRef) @constant - -(PEReference) @constant - -;; External references - -[ "PUBLIC" "SYSTEM" ] @keyword - -(PubidLiteral) @string.special - -(SystemLiteral (URI) @markup.link) - -;; Processing instructions - -(XmlModelPI "xml-model" @keyword) - -(StyleSheetPI "xml-stylesheet" @keyword) - -(PseudoAtt (Name) @property) - -(PseudoAtt (PseudoAttValue) @string) - -;; Doctype declaration - -(doctypedecl "DOCTYPE" @keyword) - -(doctypedecl (Name) @type) - -;; Tags - -(STag (Name) @tag) - -(ETag (Name) @tag) - -(EmptyElemTag (Name) @tag) - -;; Attributes - -(Attribute (Name) @property) - -(Attribute (AttValue) @string) - -;; Delimiters & punctuation - -[ - "" - "" - "<" ">" - "" -] @punctuation.delimiter - -[ "(" ")" "[" "]" ] @punctuation.bracket - -[ "\"" "'" ] @punctuation.delimiter - -[ "," "|" "=" ] @operator - -;; Text - -(CharData) @markup - -(CDSect - (CDStart) @markup.heading - (CData) @markup.raw - "]]>" @markup.heading) - -;; Misc - -(Comment) @comment - -(ERROR) @error diff --git a/src/textual/tree-sitter/highlights/yaml.scm b/src/textual/tree-sitter/highlights/yaml.scm deleted file mode 100644 index a57f464dfc..0000000000 --- a/src/textual/tree-sitter/highlights/yaml.scm +++ /dev/null @@ -1,53 +0,0 @@ -(boolean_scalar) @boolean -(null_scalar) @constant.builtin -(double_quote_scalar) @string -(single_quote_scalar) @string -((block_scalar) @string (#set! "priority" 99)) -(string_scalar) @string -(escape_sequence) @string.escape -(integer_scalar) @number -(float_scalar) @number -(comment) @comment -(anchor_name) @type -(alias_name) @type -(tag) @type -(ERROR) @error - -[ - (yaml_directive) - (tag_directive) - (reserved_directive) -] @preproc - -(block_mapping_pair - key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @yaml.field)) -(block_mapping_pair - key: (flow_node (plain_scalar (string_scalar) @yaml.field))) - -(flow_mapping - (_ key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @yaml.field))) -(flow_mapping - (_ key: (flow_node (plain_scalar (string_scalar) @yaml.field)))) - -[ - "," - "-" - ":" - ">" - "?" - "|" -] @punctuation.delimiter - -[ - "[" - "]" - "{" - "}" -] @punctuation.bracket - -[ - "*" - "&" - "---" - "..." -] @punctuation.special From ff7f0a7ee6a93ba79477ea374b4d11924a858f6c Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Tue, 9 Dec 2025 00:46:49 +0000 Subject: [PATCH 2/2] ci: ensure tests run when highlights `**.scm` file changed --- .github/workflows/pythonpackage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 407ad33b4f..eb21ac589c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -7,6 +7,7 @@ on: - "**.py" - "**.pyi" - "**.css" + - "**.scm" - "**.ambr" - "**.lock" - "Makefile"