mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -04:00
fix(c_sharp): Improve highlights
This commit is contained in:
parent
aa1424fabc
commit
182b7be541
1 changed files with 73 additions and 3 deletions
|
|
@ -3,9 +3,15 @@
|
||||||
(method_declaration
|
(method_declaration
|
||||||
name: (identifier) @method)
|
name: (identifier) @method)
|
||||||
|
|
||||||
|
(local_function_statement
|
||||||
|
name: (identifier) @method)
|
||||||
|
|
||||||
(method_declaration
|
(method_declaration
|
||||||
type: (identifier) @type)
|
type: (identifier) @type)
|
||||||
|
|
||||||
|
(local_function_statement
|
||||||
|
type: (identifier) @type)
|
||||||
|
|
||||||
(interpolation) @none
|
(interpolation) @none
|
||||||
|
|
||||||
(invocation_expression
|
(invocation_expression
|
||||||
|
|
@ -89,15 +95,47 @@
|
||||||
name: (identifier) @type)
|
name: (identifier) @type)
|
||||||
(constructor_declaration
|
(constructor_declaration
|
||||||
name: (identifier) @constructor)
|
name: (identifier) @constructor)
|
||||||
|
(constructor_initializer [
|
||||||
|
"base" @constructor
|
||||||
|
])
|
||||||
|
|
||||||
(variable_declaration
|
(variable_declaration
|
||||||
(identifier) @type)
|
(identifier) @type)
|
||||||
(object_creation_expression
|
(object_creation_expression
|
||||||
(identifier) @type)
|
(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)
|
(identifier) @type)
|
||||||
|
|
||||||
|
; Generic Method invocation with generic type
|
||||||
|
(invocation_expression
|
||||||
|
function: (generic_name) @method)
|
||||||
|
|
||||||
(invocation_expression
|
(invocation_expression
|
||||||
(member_access_expression
|
(member_access_expression
|
||||||
(generic_name
|
(generic_name
|
||||||
|
|
@ -121,6 +159,23 @@
|
||||||
(for_each_statement
|
(for_each_statement
|
||||||
type: (identifier) @type)
|
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
|
(warning_directive) @text.warning
|
||||||
(error_directive) @exception
|
(error_directive) @exception
|
||||||
|
|
||||||
|
|
@ -167,7 +222,6 @@
|
||||||
"for"
|
"for"
|
||||||
"do"
|
"do"
|
||||||
"continue"
|
"continue"
|
||||||
"in"
|
|
||||||
"goto"
|
"goto"
|
||||||
"foreach"
|
"foreach"
|
||||||
] @repeat
|
] @repeat
|
||||||
|
|
@ -249,10 +303,12 @@
|
||||||
"with"
|
"with"
|
||||||
"new"
|
"new"
|
||||||
"typeof"
|
"typeof"
|
||||||
|
"nameof"
|
||||||
"sizeof"
|
"sizeof"
|
||||||
"ref"
|
"ref"
|
||||||
"is"
|
"is"
|
||||||
"as"
|
"as"
|
||||||
|
"out"
|
||||||
] @keyword.operator
|
] @keyword.operator
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -268,6 +324,7 @@
|
||||||
"private"
|
"private"
|
||||||
"protected"
|
"protected"
|
||||||
"public"
|
"public"
|
||||||
|
"partial"
|
||||||
"readonly"
|
"readonly"
|
||||||
"sealed"
|
"sealed"
|
||||||
"static"
|
"static"
|
||||||
|
|
@ -284,10 +341,23 @@
|
||||||
"get"
|
"get"
|
||||||
"set"
|
"set"
|
||||||
"where"
|
"where"
|
||||||
|
"in"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
(parameter_modifier "this" @keyword)
|
||||||
|
|
||||||
|
(query_expression
|
||||||
|
(_ [
|
||||||
|
"from"
|
||||||
|
"orderby"
|
||||||
|
"select"
|
||||||
|
"group"
|
||||||
|
"by"
|
||||||
|
"ascending"
|
||||||
|
"descending"
|
||||||
|
] @keyword))
|
||||||
|
|
||||||
[
|
[
|
||||||
"return"
|
"return"
|
||||||
"yield"
|
"yield"
|
||||||
] @keyword.return
|
] @keyword.return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue