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

287 lines
4.3 KiB
Scheme
Raw Permalink Normal View History

2024-01-06 15:05:50 +09:00
; highlight queries.
; See the syntax at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries
; See also https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations
; for a list of recommended @ tags, though not all of them have matching
; highlights in neovim.
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"abort"
"abs"
"abstract"
"accept"
"access"
"all"
"array"
"at"
"begin"
2024-01-09 11:50:31 +02:00
"body"
2024-01-06 15:05:50 +09:00
"declare"
"delay"
"delta"
"digits"
"do"
"end"
"entry"
"exit"
"generic"
"interface"
"is"
"limited"
2024-01-09 11:50:31 +02:00
"mod"
"new"
2024-01-06 15:05:50 +09:00
"null"
"of"
"others"
"out"
2024-01-09 11:50:31 +02:00
"overriding"
"package"
2024-01-06 15:05:50 +09:00
"pragma"
"private"
2024-01-09 11:50:31 +02:00
"protected"
2024-01-06 15:05:50 +09:00
"range"
2024-01-09 11:50:31 +02:00
"separate"
"subtype"
2024-01-06 15:05:50 +09:00
"synchronized"
"tagged"
"task"
"terminate"
2024-01-09 11:50:31 +02:00
"type"
2024-01-06 15:05:50 +09:00
"until"
"when"
2022-12-14 15:59:24 +01:00
] @keyword
2024-01-06 15:05:50 +09:00
2024-04-23 12:23:15 -07:00
"record" @keyword.type
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"aliased"
"constant"
"renames"
] @keyword.modifier
2024-01-06 15:05:50 +09:00
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"with"
"use"
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
2024-01-06 15:05:50 +09:00
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"function"
"procedure"
2022-12-14 15:59:24 +01:00
] @keyword.function
2024-01-06 15:05:50 +09:00
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"and"
"in"
"not"
"or"
"xor"
2022-12-14 15:59:24 +01:00
] @keyword.operator
2024-01-06 15:05:50 +09:00
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"while"
"loop"
"for"
"parallel"
"reverse"
"some"
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
"return" @keyword.return
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"case"
"if"
"else"
"then"
"elsif"
"select"
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
2022-12-14 15:59:24 +01:00
[
2024-01-06 15:05:50 +09:00
"exception"
"raise"
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
2024-01-06 15:05:50 +09:00
(comment) @comment @spell
2024-01-06 15:05:50 +09:00
(string_literal) @string
2024-01-06 15:05:50 +09:00
2022-12-14 15:59:24 +01:00
(character_literal) @string
2024-01-06 15:05:50 +09:00
2022-12-14 15:59:24 +01:00
(numeric_literal) @number
2024-01-06 15:05:50 +09:00
; Highlight the name of subprograms
(procedure_specification
name: (_) @function)
(function_specification
name: (_) @function)
(package_declaration
name: (_) @function)
(package_body
name: (_) @function)
(generic_instantiation
name: (_) @function)
(entry_declaration
.
(identifier) @function)
; Some keywords should take different categories depending on the context
(use_clause
"use" @keyword.import
"type" @keyword.import)
(with_clause
"private" @keyword.import)
(with_clause
"limited" @keyword.import)
(use_clause
(_) @module)
(with_clause
(_) @module)
(loop_statement
"end" @keyword.repeat)
(if_statement
"end" @keyword.conditional)
(loop_parameter_specification
"in" @keyword.repeat)
(loop_parameter_specification
"in" @keyword.repeat)
(iterator_specification
[
"in"
"of"
] @keyword.repeat)
(range_attribute_designator
"range" @keyword.repeat)
(raise_statement
"with" @keyword.exception)
(gnatprep_declarative_if_statement) @keyword.directive
(gnatprep_if_statement) @keyword.directive
(gnatprep_identifier) @keyword.directive
(subprogram_declaration
"is" @keyword.function
"abstract" @keyword.function)
(aspect_specification
"with" @keyword.function)
(full_type_declaration
"is" @keyword.type)
(subtype_declaration
"is" @keyword.type)
(record_definition
"end" @keyword.type)
(full_type_declaration
(_
"access" @keyword.type))
(array_type_definition
"array" @keyword.type
"of" @keyword.type)
(access_to_object_definition
"access" @keyword.type)
(access_to_object_definition
"access" @keyword.type
[
(general_access_modifier
"constant" @keyword.type)
(general_access_modifier
"all" @keyword.type)
])
(range_constraint
"range" @keyword.type)
(signed_integer_type_definition
"range" @keyword.type)
(index_subtype_definition
"range" @keyword.type)
(record_type_definition
"abstract" @keyword.type)
(record_type_definition
"tagged" @keyword.type)
(record_type_definition
"limited" @keyword.type)
(record_type_definition
(record_definition
"null" @keyword.type))
(private_type_declaration
"is" @keyword.type
"private" @keyword.type)
(private_type_declaration
"tagged" @keyword.type)
(private_type_declaration
"limited" @keyword.type)
(task_type_declaration
"task" @keyword.type
"is" @keyword.type)
; Gray the body of expression functions
2022-12-14 15:59:24 +01:00
(expression_function_declaration
2024-01-06 15:05:50 +09:00
(function_specification)
"is"
(_) @attribute)
(subprogram_declaration
(aspect_specification) @attribute)
2022-12-14 15:59:24 +01:00
2024-01-06 15:05:50 +09:00
; Highlight full subprogram specifications
2022-12-14 15:59:24 +01:00
;(subprogram_body
; [
; (procedure_specification)
; (function_specification)
; ] @function.spec
;)
((comment) @comment.documentation
2024-01-06 15:05:50 +09:00
.
[
(entry_declaration)
(subprogram_declaration)
(parameter_specification)
])
2024-01-06 15:05:50 +09:00
(compilation_unit
.
(comment) @comment.documentation)
(component_list
(component_declaration)
2024-01-06 15:05:50 +09:00
.
(comment) @comment.documentation)
2024-01-06 15:05:50 +09:00
(enumeration_type_definition
(identifier)
2024-01-06 15:05:50 +09:00
.
(comment) @comment.documentation)