mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -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
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue