diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-02-24 06:37:45 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-03-03 07:07:52 -0800 |
| commit | 33ba346e60c3151fcdafc55d0e547556dc803c03 (patch) | |
| tree | d1c5467293ca8fe4b0f44f05f4d4aa303877a2f8 | |
| parent | docs: add `@keyword.coroutine` (diff) | |
| download | nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.tar nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.tar.gz nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.tar.bz2 nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.tar.lz nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.tar.xz nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.tar.zst nvim-treesitter-33ba346e60c3151fcdafc55d0e547556dc803c03.zip | |
feat!: add `@keyword.coroutine` capture
| -rw-r--r-- | queries/c_sharp/highlights.scm | 7 | ||||
| -rw-r--r-- | queries/clojure/highlights.scm | 14 | ||||
| -rw-r--r-- | queries/cpp/highlights.scm | 15 | ||||
| -rw-r--r-- | queries/dart/highlights.scm | 13 | ||||
| -rw-r--r-- | queries/ecma/highlights.scm | 79 | ||||
| -rw-r--r-- | queries/gdscript/highlights.scm | 9 | ||||
| -rw-r--r-- | queries/hack/highlights.scm | 7 | ||||
| -rw-r--r-- | queries/kotlin/highlights.scm | 8 | ||||
| -rw-r--r-- | queries/python/highlights.scm | 7 | ||||
| -rw-r--r-- | queries/rust/highlights.scm | 7 | ||||
| -rw-r--r-- | queries/starlark/highlights.scm | 5 | ||||
| -rw-r--r-- | queries/svelte/highlights.scm | 3 | ||||
| -rw-r--r-- | queries/swift/highlights.scm | 6 | ||||
| -rw-r--r-- | queries/thrift/highlights.scm | 11 | ||||
| -rw-r--r-- | queries/tlaplus/highlights.scm | 4 | ||||
| -rw-r--r-- | queries/vala/highlights.scm | 7 | ||||
| -rw-r--r-- | queries/zig/highlights.scm | 13 |
17 files changed, 137 insertions, 78 deletions
diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index ddb08eca4..c2bac3c1d 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -337,8 +337,6 @@ "implicit" "explicit" "override" - "async" - "await" "class" "delegate" "enum" @@ -359,6 +357,11 @@ ] @keyword [ + "async" + "await" +] @keyword.coroutine + +[ "const" "extern" "readonly" diff --git a/queries/clojure/highlights.scm b/queries/clojure/highlights.scm index 00a692521..e5609b25b 100644 --- a/queries/clojure/highlights.scm +++ b/queries/clojure/highlights.scm @@ -112,6 +112,9 @@ "deftype")) ((sym_lit) @keyword (#eq? @keyword "declare")) +((sym_name) @keyword.coroutine + (#any-of? @keyword.coroutine + "alts!" "alts!!" "await" "await-for" "await1" "chan" "close!" "future" "go" "sync" "thread" "timeout" "<!" "<!!" ">!" ">!!")) ((sym_lit) @keyword.function (#match? @keyword.function "^(defn|defn-|fn|fn[*])$")) @@ -148,13 +151,13 @@ (#any-of? @function.macro "." ".." "->" "->>" "amap" "areduce" "as->" "assert" "binding" "bound-fn" "delay" "do" "dosync" - "doto" "extend-protocol" "extend-type" "future" + "doto" "extend-protocol" "extend-type" "gen-class" "gen-interface" "io!" "lazy-cat" "lazy-seq" "let" "letfn" "locking" "memfn" "monitor-enter" "monitor-exit" "proxy" "proxy-super" "pvalues" - "refer-clojure" "reify" "set!" "some->" "some->>" "sync" + "refer-clojure" "reify" "set!" "some->" "some->>" "time" "unquote" "unquote-splicing" "var" "vswap!" - "ex-cause" "ex-data" "ex-message")) + "ex-cause" "ex-data" "ex-message")) ((sym_lit) @function.macro (#match? @function.macro "^with\\-.*$")) @@ -175,9 +178,8 @@ "any?" "apply" "array-map" "aset" "aset-boolean" "aset-byte" "aset-char" "aset-double" "aset-float" "aset-int" "aset-long" "aset-short" "assoc" "assoc!" "assoc-in" - "associative?" "atom" "await" "await-for" "await1" - "bases" "bean" "bigdec" "bigint" "biginteger" "bit-and" - "bit-and-not" "bit-clear" "bit-flip" "bit-not" "bit-or" + "associative?" "atom" "bases" "bean" "bigdec" "bigint" "biginteger" + "bit-and" "bit-and-not" "bit-clear" "bit-flip" "bit-not" "bit-or" "bit-set" "bit-shift-left" "bit-shift-right" "bit-test" "bit-xor" "boolean" "boolean-array" "boolean?" "booleans" "bound-fn*" "bound?" "bounded-count" diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm index 1f770e9f8..0f12dd8df 100644 --- a/queries/cpp/highlights.scm +++ b/queries/cpp/highlights.scm @@ -143,12 +143,20 @@ "template" "typename" "using" - "co_await" "concept" "requires" ] @keyword [ + "co_await" +] @keyword.coroutine + +[ + "co_yield" + "co_return" +] @keyword.coroutine.return + +[ "public" "private" "protected" @@ -157,11 +165,6 @@ ] @type.qualifier [ - "co_yield" - "co_return" -] @keyword.return - -[ "new" "delete" diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm index f5e391092..154a92b3a 100644 --- a/queries/dart/highlights.scm +++ b/queries/dart/highlights.scm @@ -195,14 +195,12 @@ [ "return" - "yield" ] @keyword.return ; Built in identifiers: ; alone these are marked as keywords [ - "await" "deferred" "factory" "get" @@ -217,16 +215,21 @@ ] @keyword [ + "async" + "async*" + "sync*" + "await" + "yield" +] @keyword.coroutine + +[ (const_builtin) (final_builtin) "abstract" - "async" - "async*" "covariant" "dynamic" "external" "static" - "sync*" ] @type.qualifier ; when used as an identifier: diff --git a/queries/ecma/highlights.scm b/queries/ecma/highlights.scm index e347098a3..cdae02ab2 100644 --- a/queries/ecma/highlights.scm +++ b/queries/ecma/highlights.scm @@ -210,15 +210,15 @@ ;---------- [ -"if" -"else" -"switch" -"case" + "if" + "else" + "switch" + "case" ] @conditional [ -"import" -"from" + "import" + "from" ] @include (export_specifier "as" @include) @@ -227,53 +227,56 @@ (namespace_import "as" @include) [ -"for" -"of" -"do" -"while" -"continue" + "for" + "of" + "do" + "while" + "continue" ] @repeat [ -"async" -"await" -"break" -"class" -"const" -"debugger" -"export" -"extends" -"get" -"in" -"instanceof" -"let" -"set" -"static" -"target" -"typeof" -"var" -"with" + "break" + "class" + "const" + "debugger" + "export" + "extends" + "get" + "in" + "instanceof" + "let" + "set" + "static" + "target" + "typeof" + "var" + "with" ] @keyword [ -"return" -"yield" + "async" + "await" +] @keyword.coroutine + +[ + "return" + "yield" ] @keyword.return [ - "function" + "function" ] @keyword.function [ - "new" - "delete" + "new" + "delete" ] @keyword.operator [ - "throw" - "try" - "catch" - "finally" + "throw" + "try" + "catch" + "finally" ] @exception (export_statement diff --git a/queries/gdscript/highlights.scm b/queries/gdscript/highlights.scm index 073096556..c6c6dae13 100644 --- a/queries/gdscript/highlights.scm +++ b/queries/gdscript/highlights.scm @@ -159,12 +159,15 @@ "func" @keyword.function [ - "await" "return" ] @keyword.return -(call (identifier) @keyword.return - (#eq? @keyword.return "yield")) +[ + "await" +] @keyword.coroutine + +(call (identifier) @keyword.coroutine + (#eq? @keyword.coroutine "yield")) ;; Builtins diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm index e79d62c75..ffb365c87 100644 --- a/queries/hack/highlights.scm +++ b/queries/hack/highlights.scm @@ -17,8 +17,6 @@ "function" @keyword.function [ - "async" - "await" "type" "interface" "implements" @@ -32,6 +30,11 @@ ] @keyword [ + "async" + "await" +] @keyword.coroutine + +[ "use" "include" "include_once" diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index 2fd2c089b..caf62f1f0 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -307,7 +307,13 @@ ; "typeof" ; NOTE: It is reserved for future use ] @keyword -("fun") @keyword.function +[ + "suspend" +] @keyword.coroutine + +[ + "fun" +] @keyword.function (jump_expression) @keyword.return diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 54ad82b09..fe66d7ca3 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -240,8 +240,6 @@ [ "assert" - "async" - "await" "class" "exec" "global" @@ -253,6 +251,11 @@ ] @keyword [ + "async" + "await" +] @keyword.coroutine + +[ "return" "yield" ] @keyword.return diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index db80fbb32..c24a278f6 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -169,8 +169,6 @@ (use_as_clause "as" @include) [ - "async" - "await" "default" "dyn" "enum" @@ -189,6 +187,11 @@ ] @keyword [ + "async" + "await" +] @keyword.coroutine + +[ "ref" (mutable_specifier) ] @type.qualifier diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm index 401b985d7..a92832d68 100644 --- a/queries/starlark/highlights.scm +++ b/queries/starlark/highlights.scm @@ -229,6 +229,11 @@ ] @keyword [ + "async" + "await" +] @keyword.coroutine + +[ "return" ] @keyword.return diff --git a/queries/svelte/highlights.scm b/queries/svelte/highlights.scm index 058682a7c..e1a67296e 100644 --- a/queries/svelte/highlights.scm +++ b/queries/svelte/highlights.scm @@ -8,6 +8,9 @@ (as) ] @keyword +((special_block_keyword) @keyword.coroutine + (#eq? @keyword.coroutine "await")) + [ "{" "}" diff --git a/queries/swift/highlights.scm b/queries/swift/highlights.scm index c6220984e..5773c2377 100644 --- a/queries/swift/highlights.scm +++ b/queries/swift/highlights.scm @@ -22,7 +22,6 @@ (function_declaration (simple_identifier) @method) (function_declaration ["init" @constructor]) (throws) @keyword -"async" @keyword (where_keyword) @keyword (parameter external_name: (simple_identifier) @parameter) (parameter name: (simple_identifier) @parameter) @@ -48,6 +47,11 @@ ] @keyword [ + "async" + "await" +] @keyword.coroutine + +[ (getter_specifier) (setter_specifier) (modify_specifier) diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm index c6ff6464f..5df609c3d 100644 --- a/queries/thrift/highlights.scm +++ b/queries/thrift/highlights.scm @@ -86,7 +86,6 @@ "include" "interaction" "namespace" - "oneway" "optional" "required" "senum" @@ -96,10 +95,13 @@ "union" ] @keyword +[ + "oneway" +] @keyword.coroutine + ; Deprecated Keywords [ - "async" "cocoa_prefix" "cpp_namespace" "csharp_namespace" @@ -118,7 +120,12 @@ "xsd_optional" ] @keyword +[ + "async" +] @keyword.coroutine + ; Extended Keywords + [ "client" "idempotent" diff --git a/queries/tlaplus/highlights.scm b/queries/tlaplus/highlights.scm index a94a91f4e..2199359f8 100644 --- a/queries/tlaplus/highlights.scm +++ b/queries/tlaplus/highlights.scm @@ -81,7 +81,6 @@ (pcal_algorithm_start) "algorithm" "assert" - "await" "begin" "call" "define" @@ -98,6 +97,9 @@ "when" "with" ] @keyword +[ + "await" +] @keyword.coroutine (pcal_with ("=") @keyword) (pcal_process ("=") @keyword) [ diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm index 1c9732dff..5ad7e0345 100644 --- a/queries/vala/highlights.scm +++ b/queries/vala/highlights.scm @@ -90,7 +90,6 @@ [ "abstract" - "async" "class" "construct" "continue" @@ -115,6 +114,11 @@ ] @keyword [ + "async" + "yield" +] @keyword.coroutine + +[ "const" "dynamic" "owned" @@ -183,7 +187,6 @@ [ "return" - "yield" ] @keyword.return [ diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm index e3e91dc65..60e5b373a 100644 --- a/queries/zig/highlights.scm +++ b/queries/zig/highlights.scm @@ -95,11 +95,18 @@ field_constant: (IDENTIFIER) @constant "asm" "defer" "errdefer" - "nosuspend" "test" ] @keyword [ + "async" + "await" + "suspend" + "nosuspend" + "resume" +] @keyword.coroutine + +[ "fn" ] @keyword.function @@ -111,10 +118,6 @@ field_constant: (IDENTIFIER) @constant [ "return" - "async" - "await" - "suspend" - "resume" ] @keyword.return [ |
