mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 01:10:02 -04:00
feat: add capnp (#4203)
This commit is contained in:
parent
1913ce2fd2
commit
6cf93175bf
4 changed files with 137 additions and 0 deletions
124
queries/capnp/highlights.scm
Normal file
124
queries/capnp/highlights.scm
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
; Preproc (?)
|
||||
|
||||
(unique_id) @preproc
|
||||
|
||||
; Includes
|
||||
|
||||
[
|
||||
"import"
|
||||
"$import"
|
||||
"embed"
|
||||
] @include
|
||||
|
||||
(import_path) @string
|
||||
|
||||
; Types
|
||||
|
||||
(primitive_type) @type.builtin
|
||||
|
||||
[
|
||||
"annotation"
|
||||
"enum"
|
||||
"group"
|
||||
"interface"
|
||||
"List"
|
||||
"struct"
|
||||
"union"
|
||||
] @type.builtin
|
||||
|
||||
; Typedefs
|
||||
|
||||
(type_definition) @type.definition
|
||||
|
||||
; Labels (@number, @number!)
|
||||
|
||||
(field_version) @label
|
||||
|
||||
; Methods
|
||||
|
||||
(method_identifier) @method
|
||||
|
||||
; Fields
|
||||
|
||||
(field_identifier) @field
|
||||
|
||||
; Parameters
|
||||
|
||||
(param_identifier) @parameter
|
||||
(return_identifier) @parameter
|
||||
|
||||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Constants
|
||||
|
||||
(const_identifier) @constant
|
||||
(enum_member) @constant
|
||||
|
||||
; Types
|
||||
|
||||
(enum_identifier) @type
|
||||
(extend_type) @type
|
||||
(field_type) @type
|
||||
(generic_identifier) @type
|
||||
(type_identifier) @type
|
||||
|
||||
; Attributes
|
||||
|
||||
(attribute) @attribute
|
||||
(annotation_identifier) @attribute
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
; @ ! -
|
||||
"="
|
||||
] @operator
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"extends"
|
||||
"namespace"
|
||||
"using"
|
||||
] @keyword
|
||||
|
||||
; Literals
|
||||
|
||||
(string_literal) @string
|
||||
|
||||
(data_string) @string.special
|
||||
(namespace) @string.special
|
||||
|
||||
(number) @number
|
||||
|
||||
(float) @float
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
; Misc
|
||||
|
||||
[
|
||||
"const"
|
||||
] @type.qualifier
|
||||
|
||||
[
|
||||
"*"
|
||||
] @punctuation.special
|
||||
|
||||
["{" "}"] @punctuation.bracket
|
||||
|
||||
["(" ")"] @punctuation.bracket
|
||||
|
||||
["[" "]"] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
";"
|
||||
"->"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
Loading…
Add table
Add a link
Reference in a new issue