aboutsummaryrefslogtreecommitdiffstats
path: root/queries/capnp
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-01-23 03:00:32 -0500
committerGitHub <noreply@github.com>2023-01-23 10:00:32 +0200
commit6cf93175bf011ca899e494376838ae147870a1eb (patch)
tree4a1c697faaabcf4ad2e63f0baad85017fa6083c7 /queries/capnp
parentfeat(thrift): refactor queries for better highlights, fixes bugs where certai... (diff)
downloadnvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.tar
nvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.tar.gz
nvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.tar.bz2
nvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.tar.lz
nvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.tar.xz
nvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.tar.zst
nvim-treesitter-6cf93175bf011ca899e494376838ae147870a1eb.zip
feat: add capnp (#4203)
Diffstat (limited to 'queries/capnp')
-rw-r--r--queries/capnp/highlights.scm124
1 files changed, 124 insertions, 0 deletions
diff --git a/queries/capnp/highlights.scm b/queries/capnp/highlights.scm
new file mode 100644
index 000000000..0f6815aa6
--- /dev/null
+++ b/queries/capnp/highlights.scm
@@ -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