diff options
| author | Luxed <devildead13@gmail.com> | 2021-08-05 22:02:01 -0400 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2021-08-06 11:08:30 +0200 |
| commit | d8d5e4eb8100f402b27ae98b9de4db9363f2248f (patch) | |
| tree | f06cf0cd0f5749b4bd2d03c9519e382515e0804d | |
| parent | feat(c_sharp): Simplify folds by only folding blocks of code instead of (diff) | |
| download | nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.tar nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.tar.gz nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.tar.bz2 nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.tar.lz nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.tar.xz nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.tar.zst nvim-treesitter-d8d5e4eb8100f402b27ae98b9de4db9363f2248f.zip | |
fix(c_sharp): Improve highlights
| -rw-r--r-- | queries/c_sharp/highlights.scm | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index de5f72066..53db54dcc 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -3,9 +3,15 @@ (method_declaration name: (identifier) @method) +(local_function_statement + name: (identifier) @method) + (method_declaration type: (identifier) @type) +(local_function_statement + type: (identifier) @type) + (interpolation) @none (invocation_expression @@ -89,15 +95,47 @@ name: (identifier) @type) (constructor_declaration name: (identifier) @constructor) +(constructor_initializer [ + "base" @constructor +]) (variable_declaration (identifier) @type) (object_creation_expression (identifier) @type) -(generic_name +; Generic Types. +(type_of_expression + (generic_name + (identifier) @type)) + +(type_argument_list + (generic_name + (identifier) @type)) + +(base_list + (generic_name + (identifier) @type)) + +(type_constraint + (generic_name + (identifier) @type)) + +(object_creation_expression + (generic_name + (identifier) @type)) + +(property_declaration + (generic_name + (identifier) @type)) + +type: (generic_name (identifier) @type) +; Generic Method invocation with generic type +(invocation_expression + function: (generic_name) @method) + (invocation_expression (member_access_expression (generic_name @@ -121,6 +159,23 @@ (for_each_statement type: (identifier) @type) +(tuple_element + type: (identifier) @type) + +(tuple_expression + (argument + (declaration_expression + type: (identifier) @type))) + +(as_expression + right: (identifier) @type) + +(type_of_expression + (identifier) @type) + +(name_colon + (identifier) @parameter) + (warning_directive) @text.warning (error_directive) @exception @@ -167,7 +222,6 @@ "for" "do" "continue" - "in" "goto" "foreach" ] @repeat @@ -249,10 +303,12 @@ "with" "new" "typeof" + "nameof" "sizeof" "ref" "is" "as" + "out" ] @keyword.operator [ @@ -268,6 +324,7 @@ "private" "protected" "public" + "partial" "readonly" "sealed" "static" @@ -284,10 +341,23 @@ "get" "set" "where" + "in" ] @keyword +(parameter_modifier "this" @keyword) + +(query_expression + (_ [ + "from" + "orderby" + "select" + "group" + "by" + "ascending" + "descending" + ] @keyword)) + [ "return" "yield" ] @keyword.return - |
