nvim-treesitter/runtime/queries/c_sharp/highlights.scm

594 lines
8.3 KiB
Scheme
Raw Normal View History

2024-05-03 20:10:58 -04:00
[
(identifier)
(preproc_arg)
] @variable
((preproc_arg) @constant.macro
(#lua-match? @constant.macro "^[_A-Z][_A-Z0-9]*$"))
2021-08-18 09:49:25 +03:00
((identifier) @keyword
(#eq? @keyword "value")
(#has-ancestor? @keyword accessor_declaration))
2021-08-17 20:48:29 +03:00
(method_declaration
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
name: (identifier) @function.method)
2021-08-05 22:02:01 -04:00
(local_function_statement
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
name: (identifier) @function.method)
2021-08-05 22:02:01 -04:00
(method_declaration
2024-05-03 20:10:58 -04:00
returns: [
(identifier) @type
(generic_name
(identifier) @type)
])
(event_declaration
type: (identifier) @type)
2024-05-03 20:10:58 -04:00
(event_declaration
name: (identifier) @variable.member)
(event_field_declaration
(variable_declaration
(variable_declarator
name: (identifier) @variable.member)))
(declaration_pattern
type: (identifier) @type)
2021-08-05 22:02:01 -04:00
(local_function_statement
type: (identifier) @type)
(interpolation) @none
2024-01-24 01:11:16 -05:00
(member_access_expression
name: (identifier) @variable.member)
(invocation_expression
(member_access_expression
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
name: (identifier) @function.method.call))
(invocation_expression
function: (conditional_access_expression
(member_binding_expression
name: (identifier) @function.method.call)))
(namespace_declaration
name: [
(qualified_name)
(identifier)
] @module)
(qualified_name
(identifier) @type)
2024-01-24 01:11:16 -05:00
(namespace_declaration
2024-05-03 20:10:58 -04:00
name: (identifier) @module)
(file_scoped_namespace_declaration
name: (identifier) @module)
(qualified_name
(identifier) @module
(#not-has-ancestor? @module method_declaration)
(#not-has-ancestor? @module record_declaration)
(#has-ancestor? @module namespace_declaration file_scoped_namespace_declaration))
2024-01-24 01:11:16 -05:00
(invocation_expression
2024-01-06 15:05:50 +09:00
(identifier) @function.method.call)
(field_declaration
(variable_declaration
(variable_declarator
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
(identifier) @variable.member)))
2020-07-19 12:52:50 -07:00
(initializer_expression
(assignment_expression
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
left: (identifier) @variable.member))
2020-07-19 12:52:50 -07:00
2024-05-03 20:10:58 -04:00
(parameter
name: (identifier) @variable.parameter)
(parameter
(modifier) @keyword.modifier)
(parameter_list
2024-05-03 20:10:58 -04:00
name: (identifier) @variable.parameter)
2024-05-03 20:10:58 -04:00
(bracketed_parameter_list
name: (identifier) @variable.parameter)
(implicit_parameter) @variable.parameter
2024-01-24 01:11:16 -05:00
(parameter_list
(parameter
2024-01-06 15:05:50 +09:00
type: (identifier) @type))
(integer_literal) @number
2024-01-06 15:05:50 +09:00
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
(real_literal) @number.float
(null_literal) @constant.builtin
2024-01-06 15:05:50 +09:00
2024-05-03 20:10:58 -04:00
(calling_convention
[
(identifier)
"Cdecl"
"Stdcall"
"Thiscall"
"Fastcall"
] @attribute.builtin)
(character_literal) @character
[
2024-01-06 15:05:50 +09:00
(string_literal)
(raw_string_literal)
2024-01-06 15:05:50 +09:00
(verbatim_string_literal)
(interpolated_string_expression)
] @string
(escape_sequence) @string.escape
2024-05-03 20:10:58 -04:00
[
"true"
"false"
] @boolean
2024-01-06 15:05:50 +09:00
(predefined_type) @type.builtin
(implicit_type) @keyword
2022-09-26 10:19:02 +01:00
(comment) @comment @spell
((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
((comment) @comment.documentation
(#lua-match? @comment.documentation "^///[^/]"))
2024-01-06 15:05:50 +09:00
((comment) @comment.documentation
(#lua-match? @comment.documentation "^///$"))
(using_directive
(identifier) @type)
(using_directive
2024-05-03 20:10:58 -04:00
(type) @type.definition)
2020-07-19 12:52:50 -07:00
(property_declaration
name: (identifier) @property)
(property_declaration
type: (identifier) @type)
(nullable_type
2024-05-03 20:10:58 -04:00
type: (identifier) @type)
(array_type
type: (identifier) @type)
(ref_type
type: (identifier) @type)
(pointer_type
type: (identifier) @type)
(catch_declaration
type: (identifier) @type)
(interface_declaration
name: (identifier) @type)
2024-01-06 15:05:50 +09:00
(class_declaration
name: (identifier) @type)
2024-01-06 15:05:50 +09:00
2021-08-17 20:48:29 +03:00
(record_declaration
name: (identifier) @type)
2024-01-06 15:05:50 +09:00
2024-05-03 20:10:58 -04:00
(struct_declaration
name: (identifier) @type)
(enum_declaration
name: (identifier) @type)
2024-01-06 15:05:50 +09:00
(delegate_declaration
name: (identifier) @type)
(enum_member_declaration
name: (identifier) @variable.member)
2024-05-03 20:10:58 -04:00
(operator_declaration
type: (identifier) @type)
(conversion_operator_declaration
type: (identifier) @type)
(explicit_interface_specifier
[
(identifier) @type
(generic_name
(identifier) @type)
])
(explicit_interface_specifier
(identifier) @type)
(primary_constructor_base_type
type: (identifier) @type)
[
"assembly"
"module"
"this"
"base"
] @variable.builtin
(constructor_declaration
2020-07-19 12:52:50 -07:00
name: (identifier) @constructor)
2024-01-06 15:05:50 +09:00
2024-05-03 20:10:58 -04:00
(destructor_declaration
name: (identifier) @constructor)
2024-01-06 15:05:50 +09:00
(constructor_initializer
"base" @constructor)
2020-07-19 12:52:50 -07:00
(variable_declaration
(identifier) @type)
2024-01-06 15:05:50 +09:00
(object_creation_expression
(identifier) @type)
2021-08-05 22:02:01 -04:00
; Generic Types.
2024-05-03 20:10:58 -04:00
(typeof_expression
2021-08-05 22:02:01 -04:00
(generic_name
(identifier) @type))
(type_argument_list
(generic_name
(identifier) @type))
(base_list
(generic_name
(identifier) @type))
2024-05-03 20:10:58 -04:00
(type_parameter_constraint
[
(identifier) @type
(type
(generic_name
(identifier) @type))
])
2021-08-05 22:02:01 -04:00
(object_creation_expression
(generic_name
2024-01-06 15:05:50 +09:00
(identifier) @type))
2021-08-05 22:02:01 -04:00
(property_declaration
(generic_name
(identifier) @type))
(_
type: (generic_name
(identifier) @type))
2024-01-06 15:05:50 +09:00
2021-08-05 22:02:01 -04:00
; Generic Method invocation with generic type
(invocation_expression
function: (generic_name
.
(identifier) @function.method.call))
2021-08-05 22:02:01 -04:00
(invocation_expression
(member_access_expression
(generic_name
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
(identifier) @function.method)))
(base_list
(identifier) @type)
2020-07-19 12:52:50 -07:00
(type_argument_list
2024-01-06 15:05:50 +09:00
(identifier) @type)
2020-07-19 12:52:50 -07:00
(type_parameter_list
(type_parameter) @type)
2024-05-03 20:10:58 -04:00
(type_parameter
name: (identifier) @type)
(type_parameter_constraints_clause
2024-05-03 20:10:58 -04:00
"where"
.
(identifier) @type)
(attribute
2024-01-06 15:05:50 +09:00
name: (identifier) @attribute)
2024-05-03 20:10:58 -04:00
(foreach_statement
type: (identifier) @type)
2024-05-03 20:10:58 -04:00
(goto_statement
(identifier) @label)
(labeled_statement
(identifier) @label)
2021-08-05 22:02:01 -04:00
(tuple_element
type: (identifier) @type)
(tuple_expression
(argument
(declaration_expression
type: (identifier) @type)))
2024-05-03 20:10:58 -04:00
(cast_expression
type: (identifier) @type)
(lambda_expression
type: (identifier) @type)
(lambda_expression
(modifier) @keyword.modifier)
2021-08-05 22:02:01 -04:00
(as_expression
right: (identifier) @type)
2024-05-03 20:10:58 -04:00
(typeof_expression
2021-08-05 22:02:01 -04:00
(identifier) @type)
2024-05-03 20:10:58 -04:00
(preproc_error) @keyword.exception
2021-08-05 22:02:01 -04:00
2024-05-03 20:10:58 -04:00
[
"#define"
"#undef"
] @keyword.directive.define
2024-01-06 15:05:50 +09:00
2024-05-03 20:10:58 -04:00
[
"#if"
"#elif"
"#else"
"#endif"
"#region"
"#endregion"
"#line"
"#pragma"
"#nullable"
"#error"
(shebang_directive)
] @keyword.directive
[
2024-05-03 20:10:58 -04:00
(preproc_line)
(preproc_pragma)
(preproc_nullable)
] @constant.macro
2024-05-03 20:10:58 -04:00
(preproc_pragma
(identifier) @constant)
(preproc_if
(identifier) @constant)
[
2024-01-06 15:05:50 +09:00
"if"
"else"
"switch"
"break"
"case"
"when"
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
] @keyword.conditional
[
2024-01-06 15:05:50 +09:00
"while"
"for"
"do"
"continue"
"goto"
"foreach"
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
] @keyword.repeat
[
2024-01-06 15:05:50 +09:00
"try"
"catch"
"throw"
"finally"
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
] @keyword.exception
2020-07-19 12:52:50 -07:00
[
2024-01-06 15:05:50 +09:00
"+"
"?"
":"
"++"
"-"
"--"
"&"
"&&"
"|"
"||"
"!"
"!="
"=="
"*"
"/"
"%"
"<"
"<="
">"
">="
"="
"-="
"+="
"*="
"/="
"%="
"^"
"^="
"&="
"|="
"~"
">>"
">>>"
"<<"
"<<="
">>="
">>>="
"=>"
"??"
"??="
2024-05-03 20:10:58 -04:00
".."
2020-07-19 12:52:50 -07:00
] @operator
(list_pattern
".." @character.special)
(discard) @character.special
[
2024-01-06 15:05:50 +09:00
";"
"."
","
":"
2025-07-14 17:48:23 -07:00
"::"
] @punctuation.delimiter
2024-01-06 15:05:50 +09:00
(conditional_expression
[
"?"
":"
] @keyword.conditional.ternary)
[
2024-01-06 15:05:50 +09:00
"["
"]"
"{"
"}"
"("
")"
] @punctuation.bracket
2024-05-03 20:10:58 -04:00
(interpolation_brace) @punctuation.special
(type_parameter_list
[
"<"
">"
] @punctuation.bracket)
2024-01-06 15:05:50 +09:00
(type_argument_list
[
"<"
">"
] @punctuation.bracket)
[
2024-01-06 15:05:50 +09:00
"using"
"as"
feat!: align standard captures with upstream Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
] @keyword.import
2020-07-19 12:52:50 -07:00
2021-08-17 20:48:29 +03:00
(alias_qualified_name
2024-01-06 15:05:50 +09:00
(identifier
"global") @keyword.import)
2021-08-17 20:48:29 +03:00
2020-07-19 12:52:50 -07:00
[
2024-01-06 15:05:50 +09:00
"with"
"new"
"typeof"
"sizeof"
"is"
"and"
"or"
"not"
"stackalloc"
2024-05-03 20:10:58 -04:00
"__makeref"
"__reftype"
"__refvalue"
2024-01-06 15:05:50 +09:00
"in"
"out"
"ref"
] @keyword.operator
[
2024-01-06 15:05:50 +09:00
"lock"
"params"
"operator"
"default"
"implicit"
"explicit"
"override"
"get"
"set"
"init"
"where"
"add"
"remove"
"checked"
"unchecked"
"fixed"
"alias"
2024-05-03 20:10:58 -04:00
"file"
"unsafe"
] @keyword
2024-05-03 20:10:58 -04:00
(attribute_target_specifier
.
_ @keyword)
2024-04-23 12:23:15 -07:00
[
"enum"
"record"
"class"
"struct"
"interface"
"namespace"
"event"
"delegate"
] @keyword.type
[
"async"
"await"
] @keyword.coroutine
[
2024-01-06 15:05:50 +09:00
"const"
"extern"
"readonly"
"static"
"volatile"
"required"
2024-05-03 20:10:58 -04:00
"managed"
"unmanaged"
"notnull"
2024-01-06 15:05:50 +09:00
"abstract"
"private"
"protected"
"internal"
"public"
"partial"
"sealed"
"virtual"
2024-05-03 20:10:58 -04:00
"global"
] @keyword.modifier
2024-05-03 20:10:58 -04:00
(scoped_type
"scoped" @keyword.modifier)
2021-08-05 22:02:01 -04:00
(query_expression
2024-01-06 15:05:50 +09:00
(_
[
"from"
"orderby"
"select"
"group"
"by"
"ascending"
"descending"
"equals"
"let"
] @keyword))
2021-08-05 22:02:01 -04:00
[
"return"
"yield"
] @keyword.return