diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-04-23 12:23:15 -0700 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-05-01 09:59:50 +0200 |
| commit | f58cae6c228e26681039253cb172de16cd764408 (patch) | |
| tree | 5dab18e7bf7eb9fcecc99f543a7b3c6e776291d5 | |
| parent | bot(lockfile): update angular, cpp, djot, html, json5, mlir, python, solidity... (diff) | |
| download | nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.tar nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.tar.gz nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.tar.bz2 nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.tar.lz nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.tar.xz nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.tar.zst nvim-treesitter-f58cae6c228e26681039253cb172de16cd764408.zip | |
feat: more `@keyword.type` captures
74 files changed, 393 insertions, 237 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e3081e82..7528eece5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -168,7 +168,7 @@ As languages differ quite a lot, here is a set of captures available to you when @keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python) @keyword.operator ; operators that are English words (e.g. `and` / `or`) @keyword.import ; keywords for including modules (e.g. `import` / `from` in Python) -@keyword.type ; keywords describing composite types (e.g. `struct`, `enum`) +@keyword.type ; keywords describing namespaces and composite types (e.g. `struct`, `enum`) @keyword.modifier ; keywords modifying other constructs (e.g. `const`, `static`, `public`) @keyword.repeat ; keywords related to loops (e.g. `for` / `while`) @keyword.return ; keywords like `return` and `yield` diff --git a/queries/ada/highlights.scm b/queries/ada/highlights.scm index 5b6a09978..0d42b70f9 100644 --- a/queries/ada/highlights.scm +++ b/queries/ada/highlights.scm @@ -38,7 +38,6 @@ "private" "protected" "range" - "record" "separate" "subtype" "synchronized" @@ -50,6 +49,8 @@ "when" ] @keyword +"record" @keyword.type + [ "aliased" "constant" diff --git a/queries/agda/highlights.scm b/queries/agda/highlights.scm index 657e657f9..4626a8c12 100644 --- a/queries/agda/highlights.scm +++ b/queries/agda/highlights.scm @@ -70,9 +70,10 @@ "infix" "infixl" "infixr" - "record" ] @keyword +"record" @keyword.type + ;(expr ; f_name: (atom) @function) ; Brackets diff --git a/queries/apex/highlights.scm b/queries/apex/highlights.scm index 50812f214..85453b227 100644 --- a/queries/apex/highlights.scm +++ b/queries/apex/highlights.scm @@ -227,17 +227,14 @@ [ "abstract" - "class" "continue" "default" - "enum" "extends" "final" "get" "global" "implements" "instanceof" - "interface" "on" "private" "protected" @@ -254,4 +251,10 @@ "inherited_sharing" ] @keyword +[ + "interface" + "class" + "enum" +] @keyword.type + "System.runAs" @function.builtin diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index c901b96f3..170937c8f 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -7,16 +7,19 @@ [ "default" - "enum" - "struct" - "typedef" - "union" "goto" "asm" "__asm__" ] @keyword [ + "enum" + "struct" + "union" + "typedef" +] @keyword.type + +[ "sizeof" "offsetof" ] @keyword.operator diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index e31420193..7d2621bcc 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -403,18 +403,10 @@ "implicit" "explicit" "override" - "class" - "delegate" - "enum" - "interface" - "namespace" - "struct" "get" "set" "init" "where" - "record" - "event" "add" "remove" "checked" @@ -424,6 +416,17 @@ ] @keyword [ + "enum" + "record" + "class" + "struct" + "interface" + "namespace" + "event" + "delegate" +] @keyword.type + +[ "async" "await" ] @keyword.coroutine diff --git a/queries/cairo/highlights.scm b/queries/cairo/highlights.scm index be4a749c4..1ea6245d3 100644 --- a/queries/cairo/highlights.scm +++ b/queries/cairo/highlights.scm @@ -94,8 +94,6 @@ [ ; 0.x "using" - "namespace" - "struct" "let" "const" "local" @@ -109,17 +107,22 @@ "call" "nondet" ; 1.0 - "type" "impl" "implicits" "of" "ref" "mut" - "trait" - "enum" ] @keyword [ + "struct" + "enum" + "namespace" + "type" + "trait" +] @keyword.type + +[ "func" "fn" "end" diff --git a/queries/capnp/highlights.scm b/queries/capnp/highlights.scm index b77852ef0..a48c007ed 100644 --- a/queries/capnp/highlights.scm +++ b/queries/capnp/highlights.scm @@ -15,16 +15,17 @@ (import_path) @string.special.path ; Keywords +"extends" @keyword + [ - "annotation" - "enum" - "group" - "interface" "struct" + "interface" "union" - "extends" + "enum" + "annotation" + "group" "namespace" -] @keyword +] @keyword.type ; Builtins "const" @keyword.modifier diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm index 594e0dc24..1779d59e8 100644 --- a/queries/cpp/highlights.scm +++ b/queries/cpp/highlights.scm @@ -202,21 +202,24 @@ ] @keyword.exception [ - "class" "decltype" "explicit" "friend" - "namespace" "override" - "template" - "typename" "using" - "concept" "requires" "constexpr" ] @keyword [ + "class" + "namespace" + "template" + "typename" + "concept" +] @keyword.type + +[ "co_await" "co_yield" "co_return" diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm index 2b0f0c6de..142c6e190 100644 --- a/queries/dart/highlights.scm +++ b/queries/dart/highlights.scm @@ -196,10 +196,7 @@ (case_builtin) "late" "required" - "extension" "on" - "class" - "enum" "extends" "in" "is" @@ -208,6 +205,12 @@ "with" ] @keyword +[ + "class" + "enum" + "extension" +] @keyword.type + "return" @keyword.return ; Built in identifiers: diff --git a/queries/ecma/highlights.scm b/queries/ecma/highlights.scm index 2d969aa36..12068af17 100644 --- a/queries/ecma/highlights.scm +++ b/queries/ecma/highlights.scm @@ -338,7 +338,6 @@ [ "break" - "class" "const" "debugger" "export" @@ -352,6 +351,8 @@ "with" ] @keyword +"class" @keyword.type + [ "async" "await" diff --git a/queries/facility/highlights.scm b/queries/facility/highlights.scm index 553550a70..6816b480e 100644 --- a/queries/facility/highlights.scm +++ b/queries/facility/highlights.scm @@ -17,15 +17,19 @@ (doc_comment) @comment.documentation @spell -"method" @keyword.function - [ "service" "errors" - "data" +] @keyword + +"method" @keyword.function + +[ "enum" - "extern" -] @type.builtin + "data" +] @keyword.type + +"extern" @keyword.modifier (type) @type.builtin diff --git a/queries/fidl/highlights.scm b/queries/fidl/highlights.scm index ce7727010..f1960c612 100644 --- a/queries/fidl/highlights.scm +++ b/queries/fidl/highlights.scm @@ -6,7 +6,6 @@ "closed" "compose" "const" - "enum" "error" "flexible" "library" @@ -15,15 +14,19 @@ "overlay" "protocol" "reserved" - "resource" - "service" "strict" + "using" +] @keyword + +[ + "enum" "struct" "table" - "type" "union" - "using" -] @keyword + "resource" + "service" + "type" +] @keyword.type (primitives_type) @type.builtin diff --git a/queries/fortran/highlights.scm b/queries/fortran/highlights.scm index bbe0dd6ee..34b612c8b 100644 --- a/queries/fortran/highlights.scm +++ b/queries/fortran/highlights.scm @@ -49,28 +49,18 @@ "attributes" "associate" "block" - "class" "classis" "contains" "default" "dimension" "endassociate" - "endenum" - "endinterface" - "endmodule" "endselect" - "endsubmodule" - "endtype" - "enum" "enumerator" "equivalence" "extends" "goto" - "interface" "intrinsic" "non_intrinsic" - "module" - "submodule" "namelist" "parameter" "quiet" @@ -82,10 +72,23 @@ "sequence" "stop" "target" - "type" "typeis" ] @keyword +[ + "class" + "enum" + "endenum" + "type" + "endtype" + "module" + "endmodule" + "submodule" + "endsubmodule" + "interface" + "endinterface" +] @keyword.type + (default) @keyword ; Types diff --git a/queries/fusion/highlights.scm b/queries/fusion/highlights.scm index dca576f84..7108e5705 100644 --- a/queries/fusion/highlights.scm +++ b/queries/fusion/highlights.scm @@ -46,7 +46,7 @@ (source_file) @string.special.url) (namespace_declaration - "namespace" @keyword + "namespace" @keyword.type (alias_namespace) @module) (type diff --git a/queries/gdscript/highlights.scm b/queries/gdscript/highlights.scm index 76dc89061..691d836ce 100644 --- a/queries/gdscript/highlights.scm +++ b/queries/gdscript/highlights.scm @@ -210,11 +210,9 @@ [ "pass" - "class" "class_name" "extends" "signal" - "enum" "var" "onready" "export" @@ -227,6 +225,11 @@ "puppetsync" ] @keyword +[ + "enum" + "class" +] @keyword.type + "func" @keyword.function "return" @keyword.return diff --git a/queries/gdshader/highlights.scm b/queries/gdshader/highlights.scm index fb8c053e7..c93fd4721 100644 --- a/queries/gdshader/highlights.scm +++ b/queries/gdshader/highlights.scm @@ -7,9 +7,10 @@ "const" "varying" "uniform" - "struct" ] @keyword +"struct" @keyword.type + [ (precision_qualifier) (interpolation_qualifier) diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm index 06406923b..62497b0c9 100644 --- a/queries/go/highlights.scm +++ b/queries/go/highlights.scm @@ -102,15 +102,18 @@ "default" "defer" "goto" - "interface" "range" "select" - "struct" - "type" "var" "fallthrough" ] @keyword +[ + "type" + "struct" + "interface" +] @keyword.type + "func" @keyword.function "return" @keyword.return diff --git a/queries/graphql/highlights.scm b/queries/graphql/highlights.scm index 24db06645..c1ee501c4 100644 --- a/queries/graphql/highlights.scm +++ b/queries/graphql/highlights.scm @@ -123,10 +123,6 @@ "subscription" "fragment" "scalar" - "type" - "interface" - "union" - "enum" "input" "extend" "directive" @@ -136,6 +132,13 @@ "implements" ] @keyword +[ + "enum" + "union" + "type" + "interface" +] @keyword.type + ; Punctuation ;------------ [ diff --git a/queries/groovy/highlights.scm b/queries/groovy/highlights.scm index 0266ee1f7..de62bbb4f 100644 --- a/queries/groovy/highlights.scm +++ b/queries/groovy/highlights.scm @@ -1,12 +1,13 @@ [ "!instanceof" "assert" - "class" "extends" "instanceof" "package" ] @keyword +"class" @keyword.type + [ "!in" "as" diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm index 35d71e722..bb9d2a55c 100644 --- a/queries/hack/highlights.scm +++ b/queries/hack/highlights.scm @@ -22,12 +22,8 @@ "function" @keyword.function [ - "type" - "interface" "implements" - "class" "using" - "namespace" "attribute" "const" "extends" @@ -35,6 +31,13 @@ ] @keyword [ + "class" + "type" + "interface" + "namespace" +] @keyword.type + +[ "async" "await" ] @keyword.coroutine diff --git a/queries/hare/highlights.scm b/queries/hare/highlights.scm index 67d3eb499..dc7947725 100644 --- a/queries/hare/highlights.scm +++ b/queries/hare/highlights.scm @@ -41,13 +41,16 @@ ; Keywords [ "def" - "enum" "export" "let" +] @keyword + +[ + "enum" "struct" - "type" "union" -] @keyword + "type" +] @keyword.type "fn" @keyword.function diff --git a/queries/java/highlights.scm b/queries/java/highlights.scm index 3bc7fcdd6..aadb804af 100644 --- a/queries/java/highlights.scm +++ b/queries/java/highlights.scm @@ -168,20 +168,23 @@ ; Keywords [ "assert" - "class" - "record" "default" - "enum" "extends" "implements" "instanceof" - "interface" "@interface" "permits" "to" "with" ] @keyword +[ + "record" + "class" + "enum" + "interface" +] @keyword.type + (synchronized_statement "synchronized" @keyword) diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index 18ef586ac..d67c69c3e 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -249,7 +249,7 @@ [ "struct" "end" - ] @keyword) + ] @keyword.type) (macro_definition [ diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index 4af95c4c3..f30986542 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -242,12 +242,15 @@ [ "val" "var" + ; "typeof" ; NOTE: It is reserved for future use +] @keyword + +[ "enum" "class" "object" "interface" - ; "typeof" ; NOTE: It is reserved for future use -] @keyword +] @keyword.type [ "return" diff --git a/queries/lalrpop/highlights.scm b/queries/lalrpop/highlights.scm index 951192ea8..1295f3f61 100644 --- a/queries/lalrpop/highlights.scm +++ b/queries/lalrpop/highlights.scm @@ -1,11 +1,14 @@ +"grammar" @keyword + [ - "enum" - "extern" - "grammar" - "match" "type" + "enum" +] @keyword.type + +[ "pub" -] @keyword + "extern" +] @keyword.modifier [ "match" diff --git a/queries/leo/highlights.scm b/queries/leo/highlights.scm index c0e2e4065..88e98850e 100644 --- a/queries/leo/highlights.scm +++ b/queries/leo/highlights.scm @@ -12,12 +12,15 @@ "let" "mapping" "program" - "record" "self" - "struct" "then" ] @keyword +[ + "record" + "struct" +] @keyword.type + "in" @keyword.operator [ diff --git a/queries/matlab/highlights.scm b/queries/matlab/highlights.scm index a2ebc153a..2740ef054 100644 --- a/queries/matlab/highlights.scm +++ b/queries/matlab/highlights.scm @@ -5,9 +5,7 @@ ; Keywords [ "arguments" - "classdef" "end" - "enumeration" "events" "global" "methods" @@ -15,6 +13,14 @@ "properties" ] @keyword +"enumeration" @keyword.type + +(class_definition + [ + "classdef" + "end" + ] @keyword.type) + ; Conditionals (if_statement [ diff --git a/queries/nim/highlights.scm b/queries/nim/highlights.scm index c5207ff62..df42c0f7f 100644 --- a/queries/nim/highlights.scm +++ b/queries/nim/highlights.scm @@ -408,7 +408,6 @@ "const" "let" "var" - "type" "concept" "asm" "bind" @@ -416,14 +415,18 @@ "do" "mixin" "static" - "object" "tuple" - "enum" "block" "using" "discard" ] @keyword +[ + "enum" + "object" + "type" +] @keyword.type + ; ============================================================================= ; @keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python) [ diff --git a/queries/objc/highlights.scm b/queries/objc/highlights.scm index b068bf13c..0f412404f 100644 --- a/queries/objc/highlights.scm +++ b/queries/objc/highlights.scm @@ -46,8 +46,8 @@ ] @keyword (class_declaration - "@" @keyword - "class" @keyword) ; I hate Obj-C for allowing "@ class" :) + "@" @keyword.type + "class" @keyword.type) ; I hate Obj-C for allowing "@ class" :) (method_definition [ diff --git a/queries/ocaml/highlights.scm b/queries/ocaml/highlights.scm index abd0f6bd4..10c0eb956 100644 --- a/queries/ocaml/highlights.scm +++ b/queries/ocaml/highlights.scm @@ -120,7 +120,6 @@ "as" "assert" "begin" - "class" "constraint" "end" "external" @@ -132,17 +131,21 @@ "method" "module" "new" - "object" "of" "sig" - "struct" - "type" "val" "when" "with" ] @keyword [ + "object" + "class" + "struct" + "type" +] @keyword.type + +[ "lazy" "mutable" "nonrec" diff --git a/queries/odin/highlights.scm b/queries/odin/highlights.scm index 5aafc4941..0d041f6bb 100644 --- a/queries/odin/highlights.scm +++ b/queries/odin/highlights.scm @@ -14,9 +14,6 @@ [ "foreign" "using" - "struct" - "enum" - "union" "defer" "cast" "transmute" @@ -24,9 +21,15 @@ "map" "bit_set" "matrix" - "bit_field" ] @keyword +[ + "struct" + "enum" + "union" + "bit_field" +] @keyword.type + "proc" @keyword.function [ diff --git a/queries/php_only/highlights.scm b/queries/php_only/highlights.scm index 3d88567e6..8047cc901 100644 --- a/queries/php_only/highlights.scm +++ b/queries/php_only/highlights.scm @@ -13,27 +13,30 @@ ] @keyword.function [ - "class" "clone" "declare" "default" "echo" "enddeclare" - "enum" "extends" "global" "goto" "implements" "insteadof" - "interface" "print" - "namespace" "new" - "trait" "unset" ] @keyword [ + "enum" + "class" + "interface" + "namespace" + "trait" +] @keyword.type + +[ "abstract" "const" "final" diff --git a/queries/pony/highlights.scm b/queries/pony/highlights.scm index 53024d5e5..aa65866df 100644 --- a/queries/pony/highlights.scm +++ b/queries/pony/highlights.scm @@ -3,13 +3,7 @@ ; Keywords [ - "type" - "actor" - "class" "primitive" - "interface" - "trait" - "struct" "embed" "let" "var" @@ -21,6 +15,15 @@ "where" ] @keyword +[ + "class" + "struct" + "type" + "interface" + "trait" + "actor" +] @keyword.type + "fun" @keyword.function "be" @keyword.coroutine diff --git a/queries/prisma/highlights.scm b/queries/prisma/highlights.scm index ce9c25590..9d2d1934e 100644 --- a/queries/prisma/highlights.scm +++ b/queries/prisma/highlights.scm @@ -2,13 +2,16 @@ [ "datasource" - "enum" "generator" "model" - "type" "view" ] @keyword +[ + "type" + "enum" +] @keyword.type + (comment) @comment @spell (developer_comment) @comment.documentation @spell diff --git a/queries/proto/highlights.scm b/queries/proto/highlights.scm index f67f4574e..51f44a754 100644 --- a/queries/proto/highlights.scm +++ b/queries/proto/highlights.scm @@ -1,16 +1,19 @@ [ - "enum" "extend" "extensions" - "message" "oneof" "option" "reserved" - "service" "syntax" "to" ] @keyword +[ + "enum" + "service" + "message" +] @keyword.type + "rpc" @keyword.function "returns" @keyword.return diff --git a/queries/puppet/highlights.scm b/queries/puppet/highlights.scm index d1698d736..10621930f 100644 --- a/queries/puppet/highlights.scm +++ b/queries/puppet/highlights.scm @@ -13,15 +13,18 @@ ; Keywords [ - "class" "inherits" "node" - "type" "tag" "require" ] @keyword [ + "type" + "class" +] @keyword.type + +[ "define" "function" ] @keyword.function diff --git a/queries/purescript/highlights.scm b/queries/purescript/highlights.scm index ae9e930ca..5f07e9b48 100644 --- a/queries/purescript/highlights.scm +++ b/queries/purescript/highlights.scm @@ -90,13 +90,10 @@ (where) "let" "in" - "class" "instance" "derive" "foreign" "data" - "newtype" - "type" "as" "hiding" "do" @@ -108,6 +105,12 @@ "infixr" ] @keyword +[ + "type" + "newtype" + "class" +] @keyword.type + (class_instance "else" @keyword) diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 4737fd401..663fccf55 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -300,7 +300,6 @@ [ "assert" - "class" "exec" "global" "nonlocal" @@ -308,10 +307,14 @@ "print" "with" "as" - "type" ] @keyword [ + "type" + "class" +] @keyword.type + +[ "async" "await" ] @keyword.coroutine diff --git a/queries/ql/highlights.scm b/queries/ql/highlights.scm index 434ec3316..f42812068 100644 --- a/queries/ql/highlights.scm +++ b/queries/ql/highlights.scm @@ -1,13 +1,11 @@ [ "as" "by" - "class" "extends" "from" "implies" "in" "module" - "newtype" "order" "select" "where" @@ -17,6 +15,11 @@ ] @keyword [ + "newtype" + "class" +] @keyword.type + +[ "and" "not" "or" diff --git a/queries/qmljs/highlights.scm b/queries/qmljs/highlights.scm index cef6639de..2caeb7ba3 100644 --- a/queries/qmljs/highlights.scm +++ b/queries/qmljs/highlights.scm @@ -102,13 +102,16 @@ "property" "signal" "declare" - "enum" "export" "implements" - "interface" - "namespace" - "type" "override" ] @keyword +[ + "interface" + "type" + "enum" + "namespace" +] @keyword.type + "keyof" @keyword.operator diff --git a/queries/rbs/highlights.scm b/queries/rbs/highlights.scm index f2066d855..1000e3bed 100644 --- a/queries/rbs/highlights.scm +++ b/queries/rbs/highlights.scm @@ -16,10 +16,7 @@ [ "use" "as" - "class" "module" - "interface" - "type" "def" "attr_reader" "attr_writer" @@ -28,6 +25,18 @@ "alias" ] @keyword +[ + "interface" + "type" + "class" +] @keyword.type + +(class_decl + "end" @keyword.type) + +(interface_decl + "end" @keyword.type) + "def" @keyword.function ; Members of declaration diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm index 15f709128..83cffffd4 100644 --- a/queries/ruby/highlights.scm +++ b/queries/ruby/highlights.scm @@ -8,7 +8,6 @@ [ "alias" "begin" - "class" "do" "end" "ensure" @@ -17,6 +16,8 @@ "then" ] @keyword +"class" @keyword.type + [ "return" "yield" diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index abbd2eba6..c392c030f 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -243,19 +243,22 @@ [ "default" - "enum" "impl" "let" "move" - "struct" - "trait" - "type" - "union" "unsafe" "where" ] @keyword [ + "enum" + "struct" + "union" + "trait" + "type" +] @keyword.type + +[ "async" "await" ] @keyword.coroutine diff --git a/queries/scala/highlights.scm b/queries/scala/highlights.scm index 45ef1ada4..ffecefaf4 100644 --- a/queries/scala/highlights.scm +++ b/queries/scala/highlights.scm @@ -170,8 +170,6 @@ [ "case" - "class" - "enum" "extends" "derives" "finally" @@ -180,8 +178,6 @@ "object" "override" "package" - "trait" - "type" "val" "var" "with" @@ -194,6 +190,13 @@ ] @keyword [ + "enum" + "class" + "trait" + "type" +] @keyword.type + +[ "abstract" "final" "lazy" diff --git a/queries/slint/highlights.scm b/queries/slint/highlights.scm index 4e108e28d..562499733 100644 --- a/queries/slint/highlights.scm +++ b/queries/slint/highlights.scm @@ -214,7 +214,7 @@ ] @keyword) (enum_definition - "enum" @keyword) + "enum" @keyword.type) (for_loop [ @@ -250,7 +250,7 @@ ] @keyword) (struct_definition - "struct" @keyword) + "struct" @keyword.type) (transitions_definition [ diff --git a/queries/smithy/highlights.scm b/queries/smithy/highlights.scm index 1d0321864..24389281a 100644 --- a/queries/smithy/highlights.scm +++ b/queries/smithy/highlights.scm @@ -16,7 +16,13 @@ "list" "map" "set" -] @type.builtin + "structure" + "union" + "namespace" + "service" + "operation" + "resource" +] @keyword.type ; Fields (Members) ; (field) @variable.member @@ -57,12 +63,6 @@ ; Keywords [ - "namespace" - "service" - "structure" - "operation" - "union" - "resource" "metadata" "apply" "for" diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index a9da981f4..1f1d2fe96 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -141,12 +141,8 @@ ; Keywords [ - "contract" - "interface" "library" "is" - "struct" - "enum" "event" "assembly" "emit" @@ -161,6 +157,13 @@ (virtual) ] @keyword +[ + "enum" + "struct" + "contract" + "interface" +] @keyword.type + ; FIXME: update grammar ; (block_statement "unchecked" @keyword) (event_parameter diff --git a/queries/sourcepawn/highlights.scm b/queries/sourcepawn/highlights.scm index 6fe94e610..21cbb9733 100644 --- a/queries/sourcepawn/highlights.scm +++ b/queries/sourcepawn/highlights.scm @@ -276,8 +276,6 @@ "__nullable__" "defined" "delete" - "enum" - "funcenum" "functag" "get" "methodmap" @@ -285,13 +283,18 @@ "property" "public" "set" - "struct" - "typedef" "typeset" "void" ] @keyword [ + "enum" + "funcenum" + "struct" + "typedef" +] @keyword.type + +[ "const" "native" "static" diff --git a/queries/squirrel/highlights.scm b/queries/squirrel/highlights.scm index db4e12429..351cb5d25 100644 --- a/queries/squirrel/highlights.scm +++ b/queries/squirrel/highlights.scm @@ -1,15 +1,18 @@ ; Keywords [ - "class" "clone" "delete" - "enum" "extends" "rawcall" "resume" "var" ] @keyword +[ + "class" + "enum" +] @keyword.type + "function" @keyword.function [ diff --git a/queries/swift/highlights.scm b/queries/swift/highlights.scm index 3ee1d2e8b..decb506e0 100644 --- a/queries/swift/highlights.scm +++ b/queries/swift/highlights.scm @@ -67,11 +67,6 @@ bound_identifier: (simple_identifier)) @variable [ - "typealias" - "struct" - "class" - "actor" - "enum" "protocol" "extension" "indirect" @@ -88,6 +83,13 @@ ] @keyword [ + "enum" + "struct" + "class" + "typealias" +] @keyword.type + +[ "async" "await" ] @keyword.coroutine diff --git a/queries/t32/highlights.scm b/queries/t32/highlights.scm index 1e7b420f0..9211a49d2 100644 --- a/queries/t32/highlights.scm +++ b/queries/t32/highlights.scm @@ -61,7 +61,7 @@ "enum" "struct" "union" -] @keyword +] @keyword.type "sizeof" @keyword.operator diff --git a/queries/tablegen/highlights.scm b/queries/tablegen/highlights.scm index e4084be26..8c3c42be6 100644 --- a/queries/tablegen/highlights.scm +++ b/queries/tablegen/highlights.scm @@ -7,8 +7,6 @@ ; Keywords [ "assert" - "class" - "multiclass" "field" "let" "def" @@ -17,6 +15,11 @@ "defvar" ] @keyword +[ + "multiclass" + "class" +] @keyword.type + "in" @keyword.operator ; Conditionals diff --git a/queries/tcl/highlights.scm b/queries/tcl/highlights.scm index f36f65623..c5f1f4c36 100644 --- a/queries/tcl/highlights.scm +++ b/queries/tcl/highlights.scm @@ -37,12 +37,13 @@ [ "error" - "namespace" "on" "set" "try" ] @keyword +"namespace" @keyword.type + (unpack) @operator [ diff --git a/queries/teal/highlights.scm b/queries/teal/highlights.scm index ec80ead0f..e58d588bb 100644 --- a/queries/teal/highlights.scm +++ b/queries/teal/highlights.scm @@ -153,24 +153,24 @@ ; Types (record_declaration . - "record" @keyword + "record" @keyword.type name: (identifier) @type) (anon_record . - "record" @keyword) + "record" @keyword.type) (record_body (record_declaration . - "record" @keyword + "record" @keyword.type . name: (identifier) @type)) (record_body (enum_declaration . - "enum" @keyword + "enum" @keyword.type . name: (identifier) @type)) @@ -191,7 +191,7 @@ (userdata) @keyword) (enum_declaration - "enum" @keyword + "enum" @keyword.type name: (identifier) @type) (type_declaration diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm index afb0eee4f..8955faa1f 100644 --- a/queries/thrift/highlights.scm +++ b/queries/thrift/highlights.scm @@ -120,19 +120,22 @@ ; Keywords [ - "enum" "exception" "extends" - "interaction" - "namespace" - "senum" - "service" - "struct" "typedef" - "union" "uri" ] @keyword +[ + "enum" + "struct" + "union" + "senum" + "interaction" + "namespace" + "service" +] @keyword.type + ; Deprecated Keywords [ "cocoa_prefix" diff --git a/queries/tiger/highlights.scm b/queries/tiger/highlights.scm index 901e2d571..cbb1f2310 100644 --- a/queries/tiger/highlights.scm +++ b/queries/tiger/highlights.scm @@ -42,7 +42,6 @@ "then" "type" "var" - "class" "extends" "_cast" "_chunks" @@ -51,6 +50,8 @@ "_namety" ] @keyword +"class" @keyword.type + ; }}} ; Operators {{{ (operator) @operator diff --git a/queries/typescript/highlights.scm b/queries/typescript/highlights.scm index 5fae21b96..bd13b1cb5 100644 --- a/queries/typescript/highlights.scm +++ b/queries/typescript/highlights.scm @@ -7,12 +7,9 @@ [ "declare" - "enum" "export" "implements" - "interface" "type" - "namespace" "override" "module" "asserts" @@ -22,6 +19,12 @@ ] @keyword [ + "namespace" + "interface" + "enum" +] @keyword.type + +[ "keyof" "satisfies" ] @keyword.operator diff --git a/queries/usd/highlights.scm b/queries/usd/highlights.scm index 0889f1925..d6c2a3668 100644 --- a/queries/usd/highlights.scm +++ b/queries/usd/highlights.scm @@ -39,11 +39,12 @@ (identifier) @module) [ - "class" "def" "over" ] @keyword.function +"class" @keyword.type + [ "(" ")" diff --git a/queries/v/highlights.scm b/queries/v/highlights.scm index 484f7fe59..b20389624 100644 --- a/queries/v/highlights.scm +++ b/queries/v/highlights.scm @@ -10,17 +10,20 @@ "assert" "const" "defer" - "enum" "goto" - "interface" - "struct" "sql" - "type" - "union" "unsafe" ] @keyword [ + "enum" + "union" + "struct" + "interface" + "type" +] @keyword.type + +[ "as" "in" "!in" diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm index b89df9432..0ba11caa1 100644 --- a/queries/vala/highlights.scm +++ b/queries/vala/highlights.scm @@ -174,17 +174,12 @@ [ "abstract" - "class" "construct" "continue" "default" - "delegate" - "enum" "errordomain" "get" "inline" - "interface" - "namespace" "new" "out" "override" @@ -192,12 +187,21 @@ "ref" "set" "signal" - "struct" "virtual" "with" ] @keyword [ + "enum" + "class" + "struct" + "interface" + "namespace" +] @keyword.type + +"delegate" @keyword.function + +[ "async" "yield" ] @keyword.coroutine diff --git a/queries/verilog/highlights.scm b/queries/verilog/highlights.scm index 483f194ec..e5393ac52 100644 --- a/queries/verilog/highlights.scm +++ b/queries/verilog/highlights.scm @@ -6,10 +6,6 @@ "endmodule" "program" "endprogram" - "class" - "endclass" - "interface" - "endinterface" "package" "endpackage" "checker" @@ -41,6 +37,16 @@ ] @keyword [ + "class" + "endclass" + "interface" + "endinterface" + "enum" + "struct" + "union" +] @keyword.type + +[ "function" "endfunction" "task" @@ -265,10 +271,6 @@ (data_type "packed" @keyword.modifier)) -(struct_union) @type - -"enum" @type - (enum_name_declaration (enum_identifier (simple_identifier) @constant)) diff --git a/queries/wgsl/highlights.scm b/queries/wgsl/highlights.scm index e5dd7b6ac..854ffe921 100644 --- a/queries/wgsl/highlights.scm +++ b/queries/wgsl/highlights.scm @@ -27,7 +27,6 @@ (type_declaration) @function.call) [ - "struct" "bitcast" "discard" "enable" @@ -39,6 +38,8 @@ (texel_format) ] @keyword +"struct" @keyword.type + [ "private" "storage" diff --git a/queries/wing/highlights.scm b/queries/wing/highlights.scm index 0171e09de..d417675e1 100644 --- a/queries/wing/highlights.scm +++ b/queries/wing/highlights.scm @@ -79,12 +79,13 @@ [ "as" "bring" - "class" "let" "new" (inflight_specifier) ] @keyword +"class" @keyword.type + [ "for" "in" diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm index 9ceede3e5..f0597ce34 100644 --- a/queries/zig/highlights.scm +++ b/queries/zig/highlights.scm @@ -98,14 +98,17 @@ field_constant: (IDENTIFIER) @constant "defer" "errdefer" "test" - "struct" - "union" - "enum" "opaque" "error" ] @keyword [ + "struct" + "union" + "enum" +] @keyword.type + +[ "async" "await" "suspend" diff --git a/tests/query/highlights/capnp/test.capnp b/tests/query/highlights/capnp/test.capnp index 9480affd3..b70e91358 100644 --- a/tests/query/highlights/capnp/test.capnp +++ b/tests/query/highlights/capnp/test.capnp @@ -35,7 +35,7 @@ using Cxx = import "c++.capnp"; $Cxx.namespace("capnproto_test::capnp::test"); enum TestEnum { -# <- @keyword +# <- @keyword.type # ^^^^^^^^ @type foo @0; # ^^^ @constant @@ -51,7 +51,7 @@ enum TestEnum { # <- @punctuation.bracket struct TestAllTypes { -# <- @keyword +# <- @keyword.type voidField @0 : Void; # ^^^^^^^^^ @variable.member # ^ @punctuation.special @@ -97,7 +97,7 @@ struct TestInterleavedGroups { foo @0 :UInt32; bar @2 :UInt64; union { -# ^^^^^ @keyword +# ^^^^^ @keyword.type qux @4 :UInt16; corge :group { # ^^^^^ @type @@ -114,7 +114,7 @@ struct TestInterleavedGroups { } group2 :group { -# ^^^^^ @keyword +# ^^^^^ @keyword.type foo @1 :UInt32; bar @3 :UInt64; union { @@ -214,7 +214,7 @@ struct TestGenerics(Foo, Bar) { qux @3 :Qux; interface DeepNestInterface(Quux) { -# ^^^^^^^^^ @keyword +# ^^^^^^^^^ @keyword.type # At one time this failed to compile. call @0 () -> (); # ^^^^ @function.method @@ -230,7 +230,7 @@ struct TestGenerics(Foo, Bar) { } annotation ann(struct) :Foo; -# ^^^^^^^^^^ @keyword +# ^^^^^^^^^^ @keyword.type # ^^^ @function.method # ^^^^^^ @variable.parameter.builtin diff --git a/tests/query/highlights/cpp/concepts.cpp b/tests/query/highlights/cpp/concepts.cpp index 09d975c98..3189813bc 100644 --- a/tests/query/highlights/cpp/concepts.cpp +++ b/tests/query/highlights/cpp/concepts.cpp @@ -1,7 +1,7 @@ template <class T, class U> concept Derived = std::is_base_of<U, T>::value; -// ^ @keyword +// ^ @keyword.type // ^ @type.definition template<typename T> diff --git a/tests/query/highlights/fusion/basic.fusion b/tests/query/highlights/fusion/basic.fusion index 16b99f431..5f3cc346a 100644 --- a/tests/query/highlights/fusion/basic.fusion +++ b/tests/query/highlights/fusion/basic.fusion @@ -3,7 +3,7 @@ include: SomeFile.fusion // ^ @string.special.url namespace: ns = Neos.Fusion.Space -//<- @keyword +//<- @keyword.type // ^ @module // ^ @operator // ^ @module diff --git a/tests/query/highlights/hack/use.hack b/tests/query/highlights/hack/use.hack index 0b1fde364..ab17d1140 100644 --- a/tests/query/highlights/hack/use.hack +++ b/tests/query/highlights/hack/use.hack @@ -5,9 +5,9 @@ use function Space\Func\F as E; // ^ @function // ^ @function use type Space\Type\T; -// ^ @keyword +// ^ @keyword.type use namespace Space\Name\N as M; -// ^ @keyword +// ^ @keyword.type // ^ @module use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,; diff --git a/tests/query/highlights/prisma/test.prisma b/tests/query/highlights/prisma/test.prisma index 6a5795699..5517e9eb5 100644 --- a/tests/query/highlights/prisma/test.prisma +++ b/tests/query/highlights/prisma/test.prisma @@ -47,7 +47,7 @@ model Reaction { } enum ReactionType { -// ^ keyword +// ^ keyword.type LIKE HAHA SAD diff --git a/tests/query/highlights/solidity/test.sol b/tests/query/highlights/solidity/test.sol index b53dd857d..52334bd7e 100644 --- a/tests/query/highlights/solidity/test.sol +++ b/tests/query/highlights/solidity/test.sol @@ -12,7 +12,7 @@ import * as something from "anotherFile"; /// @title Voting with delegation. // <- @comment contract Ballot { -// ^keyword +// ^keyword.type // ^ @type // This declares a new complex type which will // be used for variables later. diff --git a/tests/query/highlights/t32/var.cmm b/tests/query/highlights/t32/var.cmm index b8dc463b5..0deed996f 100644 --- a/tests/query/highlights/t32/var.cmm +++ b/tests/query/highlights/t32/var.cmm @@ -44,17 +44,17 @@ Var.Assign padd = (CAddition const * volatile)&d ; ^ @variable Var.Assign e1 = (enum e2)&e ; ^ @variable -; ^ @keyword +; ^ @keyword.type ; ^ @type ; ^ @variable Var.Assign *vector = (struct Vector3d*)&acceleration ; ^ @variable -; ^ @keyword +; ^ @keyword.type ; ^ @type ; ^ @variable Var.Assign z = (union foo)x ; ^ @variable -; ^ @keyword +; ^ @keyword.type ; ^ @type ; ^ @variable Var.Assign b = -a diff --git a/tests/query/highlights/tiger/object-oriented.tig b/tests/query/highlights/tiger/object-oriented.tig index e67029c42..5c48c543e 100644 --- a/tests/query/highlights/tiger/object-oriented.tig +++ b/tests/query/highlights/tiger/object-oriented.tig @@ -1,11 +1,11 @@ let class A extends Object {} - /* <- @keyword */ + /* <- @keyword.type */ /* ^ @keyword */ /* ^ @type.builtin */ type B = class extends A { - /* ^ @keyword */ + /* ^ @keyword.type */ /* ^ @keyword */ /* ^ @type */ diff --git a/tests/query/highlights/wing/class.w b/tests/query/highlights/wing/class.w index 602b2f749..9f76b16e8 100644 --- a/tests/query/highlights/wing/class.w +++ b/tests/query/highlights/wing/class.w @@ -2,7 +2,7 @@ bring cloud; // <- @keyword class Foo { -// <- @keyword +// <- @keyword.type // ^ @type // ^ @punctuation.bracket name: str; |
