mirror of https://github.com/helix-editor/helix
Import tree sitter queries.
parent
52da68e49a
commit
71c06c11cb
@ -1 +1 @@
|
|||||||
Subproject commit 8ece09ca4c0b5e59b124cd19fa92c76b1a9e9dd4
|
Subproject commit a8eb5cb57c66f74c63ab950de081207cccf52017
|
@ -1 +1 @@
|
|||||||
Subproject commit fa408bc9e77f4b770bd1db984ca00c901ddf95fc
|
Subproject commit f05e279aedde06a25801c3f2b2cc8ac17fac52ae
|
@ -1 +1 @@
|
|||||||
Subproject commit 21ec3c3deb4365085aa353fadbc6a616d7769f9f
|
Subproject commit 53a65a908167d6556e1fcdb67f1ee62aac101dda
|
@ -1 +1 @@
|
|||||||
Subproject commit 3bfe046f3967fef92ebb33f8cd58c3ff373d5e56
|
Subproject commit c61212414a3e95b5f7507f98e83de1d638044adc
|
@ -1 +1 @@
|
|||||||
Subproject commit e882c98b5e62d864f7f9e4d855b19b6050c897a8
|
Subproject commit 94e10230939e702b4fa3fa2cb5c3bc7173b95d07
|
@ -1 +1 @@
|
|||||||
Subproject commit dadfd9c9aab2630632e61cfce645c13c35aa092f
|
Subproject commit 2a83dfdd759a632651f852aa4dc0af2525fae5cd
|
@ -1 +1 @@
|
|||||||
Subproject commit 7f442e1c6163d450c69c75c7a621badc3a0ea98f
|
Subproject commit d93af487cc75120c89257195e6be46c999c6ba18
|
@ -1 +1 @@
|
|||||||
Subproject commit 16c07a726c34c9925b3e28716b2d6d60e3643252
|
Subproject commit bd6186c24d5eb13b4623efac9d944dcc095c0dad
|
@ -1 +1 @@
|
|||||||
Subproject commit 452151f7192cc26b70fe4a7ec192a37d99854a6a
|
Subproject commit 4a95461c4761c624f2263725aca79eeaefd36cad
|
@ -1 +1 @@
|
|||||||
Subproject commit d3976b27df8622ed17bef6dd5e358b398e73c676
|
Subproject commit 65bceef69c3b0f24c0b19ce67d79f57c96e90fcb
|
@ -1 +1 @@
|
|||||||
Subproject commit 6a0863f1ce3fcf6f99dc0addb7886dcbd27c5a48
|
Subproject commit 0ba7a24b062b671263ae08e707e9e94383b25bb7
|
@ -1 +1 @@
|
|||||||
Subproject commit b0c0367d4b7058921fdc4ba11e257441a64ab809
|
Subproject commit 0d63eaf94e8d6c0694551b016c802787e61b3fb2
|
@ -1 +1 @@
|
|||||||
Subproject commit 3196e288650992bca2399dda15ac703c342a22bb
|
Subproject commit d6210ceab11e8d812d4ab59c07c81458ec6e5184
|
@ -1 +1 @@
|
|||||||
Subproject commit 32cd5a04adb4accb0c121f037ab59df3c3488228
|
Subproject commit dfff673b41df7fadcbb609c6338f38da3cdd018e
|
@ -1 +1 @@
|
|||||||
Subproject commit 1be73c282bb6d9fd2fbb55945b313f9527cad060
|
Subproject commit a360da0a29a19c281d08295a35ecd0544d2da211
|
@ -1 +1 @@
|
|||||||
Subproject commit 211bb726bb5857f872247b600c7c1808e641a8d4
|
Subproject commit fb23ed9a99da012d86b7a5059b9d8928607cce29
|
@ -1 +1 @@
|
|||||||
Subproject commit 084da152d85cb8c4bbbe0ab5f3f1f9e5bfb77d3c
|
Subproject commit 7cff70bbcbbc62001b465603ca1ea88edd668704
|
@ -1 +1 @@
|
|||||||
Subproject commit 543cbe44f16189f7f1b739cf268d70f373d94b87
|
Subproject commit 3e897ea5925f037cfae2e551f8e6b12eec2a201a
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 1f00ecdfa36ef5e43a4feaf189e8c2c003118c00
|
|
@ -0,0 +1,81 @@
|
|||||||
|
"break" @keyword
|
||||||
|
"case" @keyword
|
||||||
|
"const" @keyword
|
||||||
|
"continue" @keyword
|
||||||
|
"default" @keyword
|
||||||
|
"do" @keyword
|
||||||
|
"else" @keyword
|
||||||
|
"enum" @keyword
|
||||||
|
"extern" @keyword
|
||||||
|
"for" @keyword
|
||||||
|
"if" @keyword
|
||||||
|
"inline" @keyword
|
||||||
|
"return" @keyword
|
||||||
|
"sizeof" @keyword
|
||||||
|
"static" @keyword
|
||||||
|
"struct" @keyword
|
||||||
|
"switch" @keyword
|
||||||
|
"typedef" @keyword
|
||||||
|
"union" @keyword
|
||||||
|
"volatile" @keyword
|
||||||
|
"while" @keyword
|
||||||
|
|
||||||
|
"#define" @keyword
|
||||||
|
"#elif" @keyword
|
||||||
|
"#else" @keyword
|
||||||
|
"#endif" @keyword
|
||||||
|
"#if" @keyword
|
||||||
|
"#ifdef" @keyword
|
||||||
|
"#ifndef" @keyword
|
||||||
|
"#include" @keyword
|
||||||
|
(preproc_directive) @keyword
|
||||||
|
|
||||||
|
"--" @operator
|
||||||
|
"-" @operator
|
||||||
|
"-=" @operator
|
||||||
|
"->" @operator
|
||||||
|
"=" @operator
|
||||||
|
"!=" @operator
|
||||||
|
"*" @operator
|
||||||
|
"&" @operator
|
||||||
|
"&&" @operator
|
||||||
|
"+" @operator
|
||||||
|
"++" @operator
|
||||||
|
"+=" @operator
|
||||||
|
"<" @operator
|
||||||
|
"==" @operator
|
||||||
|
">" @operator
|
||||||
|
"||" @operator
|
||||||
|
|
||||||
|
"." @delimiter
|
||||||
|
";" @delimiter
|
||||||
|
|
||||||
|
(string_literal) @string
|
||||||
|
(system_lib_string) @string
|
||||||
|
|
||||||
|
(null) @constant
|
||||||
|
(number_literal) @number
|
||||||
|
(char_literal) @number
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (identifier) @function)
|
||||||
|
(call_expression
|
||||||
|
function: (field_expression
|
||||||
|
field: (field_identifier) @function))
|
||||||
|
(function_declarator
|
||||||
|
declarator: (identifier) @function)
|
||||||
|
(preproc_function_def
|
||||||
|
name: (identifier) @function.special)
|
||||||
|
|
||||||
|
(field_identifier) @property
|
||||||
|
(statement_identifier) @label
|
||||||
|
(type_identifier) @type
|
||||||
|
(primitive_type) @type
|
||||||
|
(sized_type_specifier) @type
|
||||||
|
|
||||||
|
((identifier) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
(comment) @comment
|
@ -0,0 +1,68 @@
|
|||||||
|
; inherits: c
|
||||||
|
|
||||||
|
; Functions
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (scoped_identifier
|
||||||
|
name: (identifier) @function))
|
||||||
|
|
||||||
|
(template_function
|
||||||
|
name: (identifier) @function)
|
||||||
|
|
||||||
|
(template_method
|
||||||
|
name: (field_identifier) @function)
|
||||||
|
|
||||||
|
(template_function
|
||||||
|
name: (scoped_identifier
|
||||||
|
name: (identifier) @function))
|
||||||
|
|
||||||
|
(function_declarator
|
||||||
|
declarator: (scoped_identifier
|
||||||
|
name: (identifier) @function))
|
||||||
|
|
||||||
|
(function_declarator
|
||||||
|
declarator: (scoped_identifier
|
||||||
|
name: (identifier) @function))
|
||||||
|
|
||||||
|
(function_declarator
|
||||||
|
declarator: (field_identifier) @function)
|
||||||
|
|
||||||
|
; Types
|
||||||
|
|
||||||
|
((namespace_identifier) @type
|
||||||
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
|
(auto) @type
|
||||||
|
|
||||||
|
; Constants
|
||||||
|
|
||||||
|
(this) @variable.builtin
|
||||||
|
(nullptr) @constant
|
||||||
|
|
||||||
|
; Keywords
|
||||||
|
|
||||||
|
"catch" @keyword
|
||||||
|
"class" @keyword
|
||||||
|
"constexpr" @keyword
|
||||||
|
"delete" @keyword
|
||||||
|
"explicit" @keyword
|
||||||
|
"final" @keyword
|
||||||
|
"friend" @keyword
|
||||||
|
"mutable" @keyword
|
||||||
|
"namespace" @keyword
|
||||||
|
"noexcept" @keyword
|
||||||
|
"new" @keyword
|
||||||
|
"override" @keyword
|
||||||
|
"private" @keyword
|
||||||
|
"protected" @keyword
|
||||||
|
"public" @keyword
|
||||||
|
"template" @keyword
|
||||||
|
"throw" @keyword
|
||||||
|
"try" @keyword
|
||||||
|
"typename" @keyword
|
||||||
|
"using" @keyword
|
||||||
|
"virtual" @keyword
|
||||||
|
|
||||||
|
; Strings
|
||||||
|
|
||||||
|
(raw_string_literal) @string
|
@ -0,0 +1,135 @@
|
|||||||
|
; Identifier conventions
|
||||||
|
|
||||||
|
; Assume all-caps names are constants
|
||||||
|
((identifier) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z\\d_]+$'"))
|
||||||
|
|
||||||
|
; Assume that uppercase names in paths are types
|
||||||
|
((scoped_identifier
|
||||||
|
path: (identifier) @type)
|
||||||
|
(#match? @type "^[A-Z]"))
|
||||||
|
((scoped_identifier
|
||||||
|
path: (scoped_identifier
|
||||||
|
name: (identifier) @type))
|
||||||
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
|
; Assume other uppercase names are enum constructors
|
||||||
|
((identifier) @constructor
|
||||||
|
(#match? @constructor "^[A-Z]"))
|
||||||
|
|
||||||
|
; Function calls
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (identifier) @function)
|
||||||
|
(call_expression
|
||||||
|
function: (field_expression
|
||||||
|
field: (field_identifier) @function.method))
|
||||||
|
(call_expression
|
||||||
|
function: (scoped_identifier
|
||||||
|
"::"
|
||||||
|
name: (identifier) @function))
|
||||||
|
|
||||||
|
(generic_function
|
||||||
|
function: (identifier) @function)
|
||||||
|
(generic_function
|
||||||
|
function: (scoped_identifier
|
||||||
|
name: (identifier) @function))
|
||||||
|
(generic_function
|
||||||
|
function: (field_expression
|
||||||
|
field: (field_identifier) @function.method))
|
||||||
|
|
||||||
|
(macro_invocation
|
||||||
|
macro: (identifier) @function.macro
|
||||||
|
"!" @function.macro)
|
||||||
|
|
||||||
|
; Function definitions
|
||||||
|
|
||||||
|
(function_item (identifier) @function)
|
||||||
|
(function_signature_item (identifier) @function)
|
||||||
|
|
||||||
|
; Other identifiers
|
||||||
|
|
||||||
|
(type_identifier) @type
|
||||||
|
(primitive_type) @type.builtin
|
||||||
|
(field_identifier) @property
|
||||||
|
|
||||||
|
(line_comment) @comment
|
||||||
|
(block_comment) @comment
|
||||||
|
|
||||||
|
"(" @punctuation.bracket
|
||||||
|
")" @punctuation.bracket
|
||||||
|
"[" @punctuation.bracket
|
||||||
|
"]" @punctuation.bracket
|
||||||
|
|
||||||
|
(type_arguments
|
||||||
|
"<" @punctuation.bracket
|
||||||
|
">" @punctuation.bracket)
|
||||||
|
(type_parameters
|
||||||
|
"<" @punctuation.bracket
|
||||||
|
">" @punctuation.bracket)
|
||||||
|
|
||||||
|
"::" @punctuation.delimiter
|
||||||
|
"." @punctuation.delimiter
|
||||||
|
";" @punctuation.delimiter
|
||||||
|
|
||||||
|
(parameter (identifier) @variable.parameter)
|
||||||
|
|
||||||
|
(lifetime (identifier) @label)
|
||||||
|
|
||||||
|
"break" @keyword
|
||||||
|
"const" @keyword
|
||||||
|
"continue" @keyword
|
||||||
|
"default" @keyword
|
||||||
|
"dyn" @keyword
|
||||||
|
"else" @keyword
|
||||||
|
"enum" @keyword
|
||||||
|
"extern" @keyword
|
||||||
|
"fn" @keyword
|
||||||
|
"for" @keyword
|
||||||
|
"if" @keyword
|
||||||
|
"impl" @keyword
|
||||||
|
"in" @keyword
|
||||||
|
"let" @keyword
|
||||||
|
"let" @keyword
|
||||||
|
"loop" @keyword
|
||||||
|
"macro_rules!" @keyword
|
||||||
|
"match" @keyword
|
||||||
|
"mod" @keyword
|
||||||
|
"move" @keyword
|
||||||
|
"pub" @keyword
|
||||||
|
"ref" @keyword
|
||||||
|
"return" @keyword
|
||||||
|
"static" @keyword
|
||||||
|
"struct" @keyword
|
||||||
|
"trait" @keyword
|
||||||
|
"type" @keyword
|
||||||
|
"union" @keyword
|
||||||
|
"unsafe" @keyword
|
||||||
|
"use" @keyword
|
||||||
|
"where" @keyword
|
||||||
|
"while" @keyword
|
||||||
|
(mutable_specifier) @keyword
|
||||||
|
(use_list (self) @keyword)
|
||||||
|
(scoped_use_list (self) @keyword)
|
||||||
|
(scoped_identifier (self) @keyword)
|
||||||
|
(super) @keyword
|
||||||
|
|
||||||
|
(self) @variable.builtin
|
||||||
|
|
||||||
|
(char_literal) @string
|
||||||
|
(string_literal) @string
|
||||||
|
(raw_string_literal) @string
|
||||||
|
|
||||||
|
(boolean_literal) @constant.builtin
|
||||||
|
(integer_literal) @constant.builtin
|
||||||
|
(float_literal) @constant.builtin
|
||||||
|
|
||||||
|
(escape_sequence) @escape
|
||||||
|
|
||||||
|
(attribute_item) @attribute
|
||||||
|
(inner_attribute_item) @attribute
|
||||||
|
|
||||||
|
"as" @operator
|
||||||
|
"*" @operator
|
||||||
|
"&" @operator
|
||||||
|
"'" @operator
|
@ -0,0 +1,9 @@
|
|||||||
|
((macro_invocation
|
||||||
|
(token_tree) @injection.content)
|
||||||
|
(#set! injection.language "rust")
|
||||||
|
(#set! injection.include-children))
|
||||||
|
|
||||||
|
((macro_rule
|
||||||
|
(token_tree) @injection.content)
|
||||||
|
(#set! injection.language "rust")
|
||||||
|
(#set! injection.include-children))
|
Loading…
Reference in New Issue