diff options
Diffstat (limited to 'queries/c_sharp/highlights.scm')
| -rw-r--r-- | queries/c_sharp/highlights.scm | 363 |
1 files changed, 197 insertions, 166 deletions
diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index 1cd566728..3671dc258 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -26,18 +26,23 @@ name: (identifier) @function.method.call)) (invocation_expression - function: (conditional_access_expression - (member_binding_expression - name: (identifier) @function.method.call))) + function: + (conditional_access_expression + (member_binding_expression + name: (identifier) @function.method.call))) (namespace_declaration - name: [(qualified_name) (identifier)] @module) + name: + [ + (qualified_name) + (identifier) + ] @module) (qualified_name (identifier) @type) (invocation_expression - (identifier) @function.method.call) + (identifier) @function.method.call) (field_declaration (variable_declaration @@ -50,29 +55,29 @@ (parameter_list (parameter - name: (identifier) @variable.parameter)) + name: (identifier) @variable.parameter)) (parameter_list (parameter - type: (identifier) @type)) + type: (identifier) @type)) (integer_literal) @number + (real_literal) @number.float (null_literal) @constant.builtin + (character_literal) @character [ - (string_literal) - (verbatim_string_literal) - (interpolated_string_expression) + (string_literal) + (verbatim_string_literal) + (interpolated_string_expression) ] @string (boolean_literal) @boolean -[ - (predefined_type) -] @type.builtin +(predefined_type) @type.builtin (implicit_type) @keyword @@ -83,6 +88,7 @@ ((comment) @comment.documentation (#lua-match? @comment.documentation "^///[^/]")) + ((comment) @comment.documentation (#lua-match? @comment.documentation "^///$")) @@ -90,7 +96,8 @@ (identifier) @type) (using_directive - (name_equals (identifier) @type.definition)) + (name_equals + (identifier) @type.definition)) (property_declaration name: (identifier) @property) @@ -106,20 +113,25 @@ (interface_declaration name: (identifier) @type) + (class_declaration name: (identifier) @type) + (record_declaration name: (identifier) @type) + (enum_declaration name: (identifier) @type) + (constructor_declaration name: (identifier) @constructor) -(constructor_initializer [ - "base" @constructor -]) + +(constructor_initializer + "base" @constructor) (variable_declaration (identifier) @type) + (object_creation_expression (identifier) @type) @@ -142,19 +154,23 @@ (object_creation_expression (generic_name - (identifier) @type)) + (identifier) @type)) (property_declaration (generic_name (identifier) @type)) (_ - type: (generic_name - (identifier) @type)) + type: + (generic_name + (identifier) @type)) + ; Generic Method invocation with generic type (invocation_expression - function: (generic_name - . (identifier) @function.method.call)) + function: + (generic_name + . + (identifier) @function.method.call)) (invocation_expression (member_access_expression @@ -165,7 +181,7 @@ (identifier) @type) (type_argument_list - (identifier) @type) + (identifier) @type) (type_parameter_list (type_parameter) @type) @@ -174,7 +190,7 @@ target: (identifier) @type) (attribute - name: (identifier) @attribute) + name: (identifier) @attribute) (for_each_statement type: (identifier) @type) @@ -197,180 +213,194 @@ (identifier) @variable.parameter) (warning_directive) @comment.warning + (error_directive) @keyword.exception (define_directive (identifier) @constant) @constant.macro + (undef_directive (identifier) @constant) @constant.macro (line_directive) @constant.macro + (line_directive (preproc_integer_literal) @constant (preproc_string_literal)? @string) (pragma_directive (identifier) @constant) @constant.macro + (pragma_directive (preproc_string_literal) @string) @constant.macro [ - (nullable_directive) - (region_directive) - (endregion_directive) + (nullable_directive) + (region_directive) + (endregion_directive) ] @constant.macro [ - "if" - "else" - "switch" - "break" - "case" - "when" - (if_directive) - (elif_directive) - (else_directive) - (endif_directive) + "if" + "else" + "switch" + "break" + "case" + "when" + (if_directive) + (elif_directive) + (else_directive) + (endif_directive) ] @keyword.conditional (if_directive (identifier) @constant) + (elif_directive (identifier) @constant) [ - "while" - "for" - "do" - "continue" - "goto" - "foreach" + "while" + "for" + "do" + "continue" + "goto" + "foreach" ] @keyword.repeat [ - "try" - "catch" - "throw" - "finally" + "try" + "catch" + "throw" + "finally" ] @keyword.exception [ - "+" - "?" - ":" - "++" - "-" - "--" - "&" - "&&" - "|" - "||" - "!" - "!=" - "==" - "*" - "/" - "%" - "<" - "<=" - ">" - ">=" - "=" - "-=" - "+=" - "*=" - "/=" - "%=" - "^" - "^=" - "&=" - "|=" - "~" - ">>" - ">>>" - "<<" - "<<=" - ">>=" - ">>>=" - "=>" - "??" - "??=" + "+" + "?" + ":" + "++" + "-" + "--" + "&" + "&&" + "|" + "||" + "!" + "!=" + "==" + "*" + "/" + "%" + "<" + "<=" + ">" + ">=" + "=" + "-=" + "+=" + "*=" + "/=" + "%=" + "^" + "^=" + "&=" + "|=" + "~" + ">>" + ">>>" + "<<" + "<<=" + ">>=" + ">>>=" + "=>" + "??" + "??=" ] @operator [ - ";" - "." - "," - ":" + ";" + "." + "," + ":" ] @punctuation.delimiter -(conditional_expression ["?" ":"] @keyword.conditional.ternary) +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) [ - "[" - "]" - "{" - "}" - "(" - ")" + "[" + "]" + "{" + "}" + "(" + ")" ] @punctuation.bracket -(type_argument_list ["<" ">"] @punctuation.bracket) +(type_argument_list + [ + "<" + ">" + ] @punctuation.bracket) [ - (this_expression) - (base_expression) + (this_expression) + (base_expression) ] @variable.builtin [ - "using" - "as" + "using" + "as" ] @keyword.import (alias_qualified_name - (identifier "global") @keyword.import) + (identifier + "global") @keyword.import) [ - "with" - "new" - "typeof" - "sizeof" - "is" - "and" - "or" - "not" - "stackalloc" - "in" - "out" - "ref" + "with" + "new" + "typeof" + "sizeof" + "is" + "and" + "or" + "not" + "stackalloc" + "in" + "out" + "ref" ] @keyword.operator [ - "lock" - "params" - "operator" - "default" - "implicit" - "explicit" - "override" - "class" - "delegate" - "enum" - "interface" - "namespace" - "struct" - "get" - "set" - "init" - "where" - "record" - "event" - "add" - "remove" - "checked" - "unchecked" - "fixed" - "alias" + "lock" + "params" + "operator" + "default" + "implicit" + "explicit" + "override" + "class" + "delegate" + "enum" + "interface" + "namespace" + "struct" + "get" + "set" + "init" + "where" + "record" + "event" + "add" + "remove" + "checked" + "unchecked" + "fixed" + "alias" ] @keyword [ @@ -379,39 +409,40 @@ ] @keyword.coroutine [ - "const" - "extern" - "readonly" - "static" - "volatile" - "required" + "const" + "extern" + "readonly" + "static" + "volatile" + "required" ] @keyword.storage [ - "abstract" - "private" - "protected" - "internal" - "public" - "partial" - "sealed" - "virtual" + "abstract" + "private" + "protected" + "internal" + "public" + "partial" + "sealed" + "virtual" ] @type.qualifier (parameter_modifier) @operator (query_expression - (_ [ - "from" - "orderby" - "select" - "group" - "by" - "ascending" - "descending" - "equals" - "let" - ] @keyword)) + (_ + [ + "from" + "orderby" + "select" + "group" + "by" + "ascending" + "descending" + "equals" + "let" + ] @keyword)) [ "return" |
