mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 00:40:06 -04:00
Added first attempt at highlighting and text objects for csharp
This commit is contained in:
parent
64ebd4128e
commit
4d71e1455c
2 changed files with 136 additions and 0 deletions
132
queries/c_sharp/highlights.scm
Normal file
132
queries/c_sharp/highlights.scm
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
|
||||||
|
(method_declaration
|
||||||
|
name: (identifier) @method)
|
||||||
|
|
||||||
|
(parameter_list
|
||||||
|
(parameter
|
||||||
|
name: (identifier) @parameter))
|
||||||
|
|
||||||
|
[
|
||||||
|
(integer_literal)
|
||||||
|
(real_literal)
|
||||||
|
] @number
|
||||||
|
|
||||||
|
(null_literal) @constant.builtin
|
||||||
|
(character_literal) @character
|
||||||
|
|
||||||
|
[
|
||||||
|
(string_literal)
|
||||||
|
(interpolated_string_text)
|
||||||
|
] @string
|
||||||
|
|
||||||
|
(boolean_literal) @boolean
|
||||||
|
|
||||||
|
[
|
||||||
|
(predefined_type)
|
||||||
|
(implicit_type)
|
||||||
|
(void_keyword)
|
||||||
|
] @type.builtin
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
(using_directive
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(using_directive
|
||||||
|
(qualified_name
|
||||||
|
(identifier) @type))
|
||||||
|
|
||||||
|
(interface_declaration
|
||||||
|
name: (identifier) @type)
|
||||||
|
(class_declaration
|
||||||
|
name: (identifier) @type)
|
||||||
|
(enum_declaration
|
||||||
|
name: (identifier) @type)
|
||||||
|
(constructor_declaration
|
||||||
|
name: (identifier) @type)
|
||||||
|
(variable_declaration
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(object_creation_expression
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(attribute
|
||||||
|
name: (identifier) @attribute)
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"else"
|
||||||
|
"switch"
|
||||||
|
"case"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"while"
|
||||||
|
"for"
|
||||||
|
"do"
|
||||||
|
"continue"
|
||||||
|
"break"
|
||||||
|
"goto"
|
||||||
|
"foreach"
|
||||||
|
] @repeat
|
||||||
|
|
||||||
|
[
|
||||||
|
"try"
|
||||||
|
"catch"
|
||||||
|
"throw"
|
||||||
|
"finally"
|
||||||
|
] @exception
|
||||||
|
|
||||||
|
[
|
||||||
|
";"
|
||||||
|
"."
|
||||||
|
","
|
||||||
|
":"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
"using"
|
||||||
|
"lock"
|
||||||
|
"params"
|
||||||
|
"ref"
|
||||||
|
"sizeof"
|
||||||
|
"operator"
|
||||||
|
"is"
|
||||||
|
"as"
|
||||||
|
"new"
|
||||||
|
"default"
|
||||||
|
"yield"
|
||||||
|
"return"
|
||||||
|
"typeof"
|
||||||
|
"abstract"
|
||||||
|
"const"
|
||||||
|
"extern"
|
||||||
|
"internal"
|
||||||
|
"override"
|
||||||
|
"private"
|
||||||
|
"protected"
|
||||||
|
"public"
|
||||||
|
"readonly"
|
||||||
|
"sealed"
|
||||||
|
"static"
|
||||||
|
"virtual"
|
||||||
|
"volatile"
|
||||||
|
"async"
|
||||||
|
"await"
|
||||||
|
"class"
|
||||||
|
"delegate"
|
||||||
|
"enum"
|
||||||
|
"interface"
|
||||||
|
"namespace"
|
||||||
|
"struct"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
4
queries/c_sharp/textobjects.scm
Normal file
4
queries/c_sharp/textobjects.scm
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
(method_declaration
|
||||||
|
body: (block) ? @function.inner) @function.outer
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue