mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-08 02:35:44 +02:00
lint: autoformat all tree-sitter query files
This commit is contained in:
parent
690290be7f
commit
75de06f8ed
37 changed files with 483 additions and 553 deletions
|
@ -1,4 +1,3 @@
|
|||
(function_definition
|
||||
name: (word) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
(type_definition
|
||||
type: (enum_specifier) @symbol
|
||||
declarator: (type_identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @start
|
||||
(#set! "kind" "Enum")) @start
|
||||
|
||||
(type_definition
|
||||
type: (struct_specifier) @symbol
|
||||
declarator: (type_identifier) @name
|
||||
(#set! "kind" "Struct")
|
||||
) @start
|
||||
(#set! "kind" "Struct")) @start
|
||||
|
||||
(
|
||||
(declaration) @root @start
|
||||
((declaration) @root @start
|
||||
.
|
||||
(function_definition) @symbol @end
|
||||
(#set! "kind" "Function")
|
||||
)
|
||||
(#set! "kind" "Function"))
|
||||
|
||||
(function_definition
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @root
|
||||
(#set! "kind" "Function")) @symbol @root
|
||||
|
|
|
@ -1,41 +1,33 @@
|
|||
(interface_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(class_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(struct_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
||||
(method_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(enum_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
||||
(constructor_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Constructor")
|
||||
) @symbol
|
||||
(#set! "kind" "Constructor")) @symbol
|
||||
|
||||
(property_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Property")
|
||||
) @symbol
|
||||
(#set! "kind" "Property")) @symbol
|
||||
|
||||
(field_declaration
|
||||
(variable_declaration
|
||||
(variable_declaration
|
||||
(variable_declarator
|
||||
(identifier) @name))
|
||||
(#set! "kind" "Field")
|
||||
) @symbol
|
||||
(identifier) @name))
|
||||
(#set! "kind" "Field")) @symbol
|
||||
|
|
|
@ -1,28 +1,22 @@
|
|||
(struct_specifier
|
||||
name: (type_identifier) @name
|
||||
body: (field_declaration_list)
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
||||
(declaration
|
||||
(struct_specifier
|
||||
body: (field_declaration_list)
|
||||
) @symbol
|
||||
body: (field_declaration_list)) @symbol
|
||||
declarator: (identifier) @name
|
||||
(#set! "kind" "Struct")
|
||||
)
|
||||
(#set! "kind" "Struct"))
|
||||
|
||||
(function_declarator
|
||||
declarator: (_) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(enum_specifier
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
||||
(class_specifier
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
|
|
@ -1,37 +1,30 @@
|
|||
(class_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(constructor_signature
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Constructor")
|
||||
) @symbol
|
||||
(#set! "kind" "Constructor")) @symbol
|
||||
|
||||
(
|
||||
(method_signature
|
||||
[(function_signature
|
||||
((method_signature
|
||||
[
|
||||
(function_signature
|
||||
name: (identifier) @name)
|
||||
(getter_signature
|
||||
(getter_signature
|
||||
name: (identifier) @name)
|
||||
(setter_signature
|
||||
(setter_signature
|
||||
name: (identifier) @name)
|
||||
]
|
||||
) @symbol
|
||||
]) @symbol
|
||||
.
|
||||
(function_body) @end
|
||||
(#set! "kind" "Method")
|
||||
)
|
||||
(#set! "kind" "Method"))
|
||||
|
||||
(
|
||||
(function_signature
|
||||
name: (identifier) @name) @symbol
|
||||
((function_signature
|
||||
name: (identifier) @name) @symbol
|
||||
.
|
||||
(function_body) @end
|
||||
(#set! "kind" "Function")
|
||||
)
|
||||
(#set! "kind" "Function"))
|
||||
|
||||
(enum_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
|
|
@ -1,75 +1,83 @@
|
|||
(call
|
||||
target: (identifier) @identifier (#any-of? @identifier "defmodule" "defprotocol")
|
||||
target: (identifier) @identifier
|
||||
(#any-of? @identifier "defmodule" "defprotocol")
|
||||
(arguments) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(call
|
||||
target: (identifier) @identifier (#eq? @identifier "defimpl")
|
||||
target: (identifier) @identifier
|
||||
(#eq? @identifier "defimpl")
|
||||
(arguments
|
||||
(alias) @protocol
|
||||
(keywords (pair
|
||||
key: (keyword) @kw (#match? @kw "^for:")
|
||||
value: (alias) @name))
|
||||
)
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(keywords
|
||||
(pair
|
||||
key: (keyword) @kw
|
||||
(#match? @kw "^for:")
|
||||
value: (alias) @name)))
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(call
|
||||
target: (identifier) @identifier (#any-of? @identifier "def" "defp" "defguard" "defmacro" "defmacrop")
|
||||
(arguments [
|
||||
(call target: (identifier) @name)
|
||||
(binary_operator left: (call target: (identifier) @name))
|
||||
((identifier) @name)
|
||||
])
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
target: (identifier) @identifier
|
||||
(#any-of? @identifier "def" "defp" "defguard" "defmacro" "defmacrop")
|
||||
(arguments
|
||||
[
|
||||
(call
|
||||
target: (identifier) @name)
|
||||
(binary_operator
|
||||
left: (call
|
||||
target: (identifier) @name))
|
||||
(identifier) @name
|
||||
])
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(unary_operator
|
||||
operator: "@"
|
||||
operand: (call
|
||||
target: (identifier) @identifier (#any-of? @identifier "callback" "spec")
|
||||
(arguments [
|
||||
(call target: (identifier) @name)
|
||||
(binary_operator left: (call target: (identifier) @name))
|
||||
]))
|
||||
@symbol
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
target: (identifier) @identifier
|
||||
(#any-of? @identifier "callback" "spec")
|
||||
(arguments
|
||||
[
|
||||
(call
|
||||
target: (identifier) @name)
|
||||
(binary_operator
|
||||
left: (call
|
||||
target: (identifier) @name))
|
||||
])) @symbol
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(unary_operator
|
||||
operator: "@"
|
||||
operand: (call
|
||||
target: (identifier) @identifier (#eq? @identifier "module_attribute")
|
||||
(arguments) @name
|
||||
) @symbol
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
target: (identifier) @identifier
|
||||
(#eq? @identifier "module_attribute")
|
||||
(arguments) @name) @symbol
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(unary_operator
|
||||
operator: "@"
|
||||
operand: (call target: (identifier) @name (#not-any-of? @name "module_attribute" "callback" "spec" "doc" "moduledoc")) @symbol
|
||||
(#set! "kind" "Constant")
|
||||
) @start
|
||||
|
||||
operand: (call
|
||||
target: (identifier) @name
|
||||
(#not-any-of? @name "module_attribute" "callback" "spec" "doc" "moduledoc")) @symbol
|
||||
(#set! "kind" "Constant")) @start
|
||||
|
||||
(do_block
|
||||
(call
|
||||
target: (identifier) @identifier (#eq? @identifier "defstruct")) @symbol
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
target: (identifier) @identifier
|
||||
(#eq? @identifier "defstruct")) @symbol
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
; exunit unit test
|
||||
(call
|
||||
target: (identifier) @identifier (#any-of? @identifier "describe" "test")
|
||||
(arguments [(string (quoted_content) @name)])
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
target: (identifier) @identifier
|
||||
(#any-of? @identifier "describe" "test")
|
||||
(arguments
|
||||
(string
|
||||
(quoted_content) @name))
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
; exunit test setup
|
||||
(do_block
|
||||
(call
|
||||
target: (identifier) @identifier @name (#eq? @identifier "setup")) @symbol
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
|
||||
target: (identifier) @identifier @name
|
||||
(#eq? @identifier "setup")) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
(function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(type_declaration
|
||||
(type_spec
|
||||
name: (type_identifier) @name
|
||||
type: (struct_type) @symbol)
|
||||
(#set! "kind" "Struct")
|
||||
) @start
|
||||
(#set! "kind" "Struct")) @start
|
||||
|
||||
(type_declaration
|
||||
(type_spec
|
||||
name: (type_identifier) @name
|
||||
type: (interface_type) @symbol)
|
||||
(#set! "kind" "Interface")
|
||||
) @start
|
||||
(#set! "kind" "Interface")) @start
|
||||
|
||||
(method_declaration
|
||||
receiver: (_) @receiver
|
||||
name: (field_identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
(juxt_function_call
|
||||
function: (identifier) @name (#not-any-of? @name "else" "try" "exec")
|
||||
(argument_list (closure))
|
||||
(#set! "kind" "Module")
|
||||
) @symbol
|
||||
function: (identifier) @name
|
||||
(#not-any-of? @name "else" "try" "exec")
|
||||
(argument_list
|
||||
(closure))
|
||||
(#set! "kind" "Module")) @symbol
|
||||
|
||||
(declaration
|
||||
name: (identifier) @name
|
||||
(closure)
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(juxt_function_call
|
||||
function: (identifier) @keyword (#eq? @keyword "task")
|
||||
(argument_list ((function_call function: (identifier) @name)))
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
function: (identifier) @keyword
|
||||
(#eq? @keyword "task")
|
||||
(argument_list
|
||||
(function_call
|
||||
function: (identifier) @name))
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(declaration
|
||||
(declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Constant")
|
||||
) @symbol
|
||||
(#set! "kind" "Constant")) @symbol
|
||||
|
|
|
@ -3,16 +3,13 @@
|
|||
(h1
|
||||
(word)+ @name @start
|
||||
(tag)
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(h2
|
||||
(word)+ @name @start
|
||||
(tag)
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(tag
|
||||
text: (word) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
((doctype) @name
|
||||
(#set! "kind" "Module")
|
||||
) @symbol
|
||||
(#set! "kind" "Module")) @symbol
|
||||
|
||||
(_
|
||||
[
|
||||
(start_tag (tag_name) @name)
|
||||
(self_closing_tag (tag_name) @name)
|
||||
(start_tag
|
||||
(tag_name) @name)
|
||||
(self_closing_tag
|
||||
(tag_name) @name)
|
||||
]
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
||||
(attribute (attribute_name) @name
|
||||
(#set! "kind" "Field")
|
||||
) @symbol
|
||||
(attribute
|
||||
(attribute_name) @name
|
||||
(#set! "kind" "Field")) @symbol
|
||||
|
|
|
@ -1,30 +1,24 @@
|
|||
(interface_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(method_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(constructor_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Constructor")
|
||||
) @symbol
|
||||
(#set! "kind" "Constructor")) @symbol
|
||||
|
||||
(class_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(enum_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
||||
(field_declaration
|
||||
declarator: (variable_declarator
|
||||
name: (identifier) @name)
|
||||
(#set! "kind" "Field")
|
||||
) @symbol
|
||||
(#set! "kind" "Field")) @symbol
|
||||
|
|
|
@ -1,69 +1,65 @@
|
|||
(class_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(generator_function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(method_definition
|
||||
name: (property_identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(field_definition
|
||||
property: (property_identifier) @name
|
||||
value: (arrow_function)
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
; const fn = () => {}
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
name: (identifier) @name
|
||||
value: [(arrow_function) (function_expression) (generator_function)] @symbol
|
||||
)
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
value: [
|
||||
(arrow_function)
|
||||
(function_expression)
|
||||
(generator_function)
|
||||
] @symbol)
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
; describe("Unit test")
|
||||
(call_expression
|
||||
function: (identifier) @method @name (#any-of? @method "describe" "it" "test" "afterAll" "afterEach" "beforeAll" "beforeEach")
|
||||
function: (identifier) @method @name
|
||||
(#any-of? @method "describe" "it" "test" "afterAll" "afterEach" "beforeAll" "beforeEach")
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
; test.skip("this test")
|
||||
(call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @method (#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier (#any-of? @modifier "skip" "todo")
|
||||
) @name
|
||||
object: (identifier) @method
|
||||
(#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier
|
||||
(#any-of? @modifier "skip" "todo")) @name
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
; describe.each([])("Test suite")
|
||||
(call_expression
|
||||
function: (call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @method (#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier (#any-of? @modifier "each")
|
||||
) @name
|
||||
)
|
||||
object: (identifier) @method
|
||||
(#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier
|
||||
(#any-of? @modifier "each")) @name)
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
key: (string
|
||||
(string_content) @name)
|
||||
value: (object) @symbol
|
||||
(#set! "kind" "Class")
|
||||
) @start
|
||||
(#set! "kind" "Class")) @start
|
||||
|
|
|
@ -1,45 +1,38 @@
|
|||
(module_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Module")
|
||||
) @symbol
|
||||
(#set! "kind" "Module")) @symbol
|
||||
|
||||
(function_definition
|
||||
(signature
|
||||
((call_expression) @name))
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(call_expression) @name)
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(assignment
|
||||
.
|
||||
(where_expression
|
||||
((call_expression) @name))
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(call_expression) @name)
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(assignment
|
||||
.
|
||||
((call_expression) @name)
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(call_expression) @name
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(abstract_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(struct_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(const_statement
|
||||
(assignment
|
||||
. (identifier) @name)
|
||||
(#set! "kind" "Constant")
|
||||
) @symbol
|
||||
.
|
||||
(identifier) @name)
|
||||
(#set! "kind" "Constant")) @symbol
|
||||
|
||||
(macro_definition
|
||||
(signature
|
||||
((call_expression) @name))
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(call_expression) @name)
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -1,32 +1,56 @@
|
|||
(section
|
||||
text: [(curly_group (text) @name) (_)] @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
text: [
|
||||
(curly_group
|
||||
(text) @name)
|
||||
(_)
|
||||
] @name
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(subsection
|
||||
text: [(curly_group (text) @name) (_)] @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
text: [
|
||||
(curly_group
|
||||
(text) @name)
|
||||
(_)
|
||||
] @name
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(subsubsection
|
||||
text: [(curly_group (text) @name) (_)] @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
text: [
|
||||
(curly_group
|
||||
(text) @name)
|
||||
(_)
|
||||
] @name
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(generic_environment
|
||||
begin: (begin
|
||||
name: [(curly_group_text text: (text) @name) (_)] @name
|
||||
)
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
name: [
|
||||
(curly_group_text
|
||||
text: (text) @name)
|
||||
(_)
|
||||
] @name)
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(new_command_definition
|
||||
declaration: [(curly_group_command_name command: (command_name) @name) (_)] @name
|
||||
(#set! "kind" "Operator")
|
||||
) @symbol
|
||||
declaration: [
|
||||
(curly_group_command_name
|
||||
command: (command_name) @name)
|
||||
(_)
|
||||
] @name
|
||||
(#set! "kind" "Operator")) @symbol
|
||||
|
||||
(title_declaration
|
||||
text: [(curly_group (text) @name) (_)] @name
|
||||
(#set! "kind" "Field")
|
||||
) @symbol
|
||||
text: [
|
||||
(curly_group
|
||||
(text) @name)
|
||||
(_)
|
||||
] @name
|
||||
(#set! "kind" "Field")) @symbol
|
||||
|
||||
(author_declaration
|
||||
authors: [(curly_group_author_list (author) @name) (_)] @name
|
||||
(#set! "kind" "Field")
|
||||
) @symbol
|
||||
authors: [
|
||||
(curly_group_author_list
|
||||
(author) @name)
|
||||
(_)
|
||||
] @name
|
||||
(#set! "kind" "Field")) @symbol
|
||||
|
|
|
@ -1,46 +1,53 @@
|
|||
(function_declaration
|
||||
name: [(identifier) (dot_index_expression) (method_index_expression)] @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
name: [
|
||||
(identifier)
|
||||
(dot_index_expression)
|
||||
(method_index_expression)
|
||||
] @name
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(variable_declaration
|
||||
(assignment_statement
|
||||
(variable_list
|
||||
name: [(identifier) (dot_index_expression)] @name)
|
||||
name: [
|
||||
(identifier)
|
||||
(dot_index_expression)
|
||||
] @name)
|
||||
(expression_list
|
||||
value: (function_definition) @symbol))
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(assignment_statement
|
||||
(variable_list
|
||||
name: [(identifier) (dot_index_expression) (bracket_index_expression)] @name)
|
||||
name: [
|
||||
(identifier)
|
||||
(dot_index_expression)
|
||||
(bracket_index_expression)
|
||||
] @name)
|
||||
(expression_list
|
||||
value: (function_definition) @symbol)
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(field
|
||||
name: (identifier) @name
|
||||
value: (function_definition) @symbol
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(function_call
|
||||
name: (identifier) @method @name (#any-of? @method "describe" "it" "before_each" "after_each" "setup" "teardown")
|
||||
name: (identifier) @method @name
|
||||
(#any-of? @method "describe" "it" "before_each" "after_each" "setup" "teardown")
|
||||
arguments: (arguments
|
||||
(string)? @name
|
||||
(function_definition) @symbol)
|
||||
(#set! "kind" "Function")
|
||||
) @start @selection
|
||||
(#set! "kind" "Function")) @start @selection
|
||||
|
||||
(function_call
|
||||
name: (dot_index_expression
|
||||
table: (identifier) @tbl (#match? @tbl "^a")
|
||||
field: (identifier) @method @name (#any-of? @method "describe" "it" "before_each" "after_each")
|
||||
)
|
||||
table: (identifier) @tbl
|
||||
(#match? @tbl "^a")
|
||||
field: (identifier) @method @name
|
||||
(#any-of? @method "describe" "it" "before_each" "after_each"))
|
||||
arguments: (arguments
|
||||
(string)? @name
|
||||
(function_definition) @symbol)
|
||||
(#set! "kind" "Function")
|
||||
) @start @selection
|
||||
(#set! "kind" "Function")) @start @selection
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
(rule
|
||||
(targets) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
(atx_heading
|
||||
[(atx_h1_marker) (atx_h2_marker) (atx_h3_marker) (atx_h4_marker) (atx_h5_marker) (atx_h6_marker)] @level
|
||||
[
|
||||
(atx_h1_marker)
|
||||
(atx_h2_marker)
|
||||
(atx_h3_marker)
|
||||
(atx_h4_marker)
|
||||
(atx_h5_marker)
|
||||
(atx_h6_marker)
|
||||
] @level
|
||||
heading_content: (_) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(setext_heading
|
||||
heading_content: (_) @name
|
||||
(#set! "kind" "Interface")
|
||||
[(setext_h1_underline) (setext_h2_underline)] @level
|
||||
) @symbol
|
||||
[
|
||||
(setext_h1_underline)
|
||||
(setext_h2_underline)
|
||||
] @level) @symbol
|
||||
|
|
|
@ -1,36 +1,30 @@
|
|||
;; Headings
|
||||
; Headings
|
||||
((heading1
|
||||
(heading1_prefix)
|
||||
title: (paragraph_segment) @name) @symbol
|
||||
(#set! "kind" "Interface")
|
||||
)
|
||||
(#set! "kind" "Interface"))
|
||||
|
||||
((heading2
|
||||
(heading2_prefix)
|
||||
title: (paragraph_segment) @name) @symbol
|
||||
(#set! "kind" "Interface")
|
||||
)
|
||||
(#set! "kind" "Interface"))
|
||||
|
||||
((heading3
|
||||
(heading3_prefix)
|
||||
title: (paragraph_segment) @name) @symbol
|
||||
(#set! "kind" "Interface")
|
||||
)
|
||||
(#set! "kind" "Interface"))
|
||||
|
||||
((heading4
|
||||
(heading4_prefix)
|
||||
title: (paragraph_segment) @name) @symbol
|
||||
(#set! "kind" "Interface")
|
||||
)
|
||||
(#set! "kind" "Interface"))
|
||||
|
||||
((heading5
|
||||
(heading5_prefix)
|
||||
title: (paragraph_segment) @name) @symbol
|
||||
(#set! "kind" "Interface")
|
||||
)
|
||||
(#set! "kind" "Interface"))
|
||||
|
||||
((heading6
|
||||
(heading6_prefix)
|
||||
title: (paragraph_segment) @name) @symbol
|
||||
(#set! "kind" "Interface")
|
||||
)
|
||||
(#set! "kind" "Interface"))
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
(section
|
||||
(headline
|
||||
item: (item) @name)
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
|
|
@ -1,32 +1,25 @@
|
|||
(function_definition
|
||||
name: (name) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(expression_statement
|
||||
(assignment_expression
|
||||
left: (variable_name) @name
|
||||
right: (anonymous_function_creation_expression) @symbol
|
||||
)
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
right: (anonymous_function_creation_expression) @symbol)
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(class_declaration
|
||||
name: (name) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(method_declaration
|
||||
name: (name) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(interface_declaration
|
||||
name: (name) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(trait_declaration
|
||||
name: (name) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
(message
|
||||
(message_name) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(enum
|
||||
(enum_name) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(class_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(assignment
|
||||
left: (_) @name
|
||||
(#set! "kind" "Variable")
|
||||
) @symbol
|
||||
(#set! "kind" "Variable")) @symbol
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
(section
|
||||
(title) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
|
|
@ -1,66 +1,76 @@
|
|||
(class
|
||||
name: [(constant) (scope_resolution)] @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
name: [
|
||||
(constant)
|
||||
(scope_resolution)
|
||||
] @name
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(call
|
||||
(
|
||||
(identifier) @scope
|
||||
(#any-of? @scope "private" "protected" "public")
|
||||
)?
|
||||
((identifier) @scope
|
||||
(#any-of? @scope "private" "protected" "public"))?
|
||||
.
|
||||
(argument_list
|
||||
(method
|
||||
name: (_) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
)
|
||||
)
|
||||
(#set! "kind" "Method")) @symbol))
|
||||
|
||||
(body_statement
|
||||
[
|
||||
(_)
|
||||
((identifier) @scope
|
||||
(#any-of? @scope "private" "protected" "public"))
|
||||
]*
|
||||
(_)
|
||||
((identifier) @scope
|
||||
(#any-of? @scope "private" "protected" "public"))
|
||||
]*
|
||||
.
|
||||
(method
|
||||
name: (_) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
)
|
||||
(#set! "kind" "Method")) @symbol)
|
||||
|
||||
(singleton_method
|
||||
object: [(constant) (self) (identifier)] @receiver
|
||||
(["." "::"] @separator)?
|
||||
name: [(operator) (identifier)] @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
object: [
|
||||
(constant)
|
||||
(self)
|
||||
(identifier)
|
||||
] @receiver
|
||||
([
|
||||
"."
|
||||
"::"
|
||||
] @separator)?
|
||||
name: [
|
||||
(operator)
|
||||
(identifier)
|
||||
] @name
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(singleton_class
|
||||
value: (_) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(module
|
||||
name: [(constant) (scope_resolution)] @name
|
||||
(#set! "kind" "Module")
|
||||
) @symbol
|
||||
name: [
|
||||
(constant)
|
||||
(scope_resolution)
|
||||
] @name
|
||||
(#set! "kind" "Module")) @symbol
|
||||
|
||||
; For Rspec, Rake, and Shoulda
|
||||
(call
|
||||
method: (identifier) @method @name
|
||||
(#any-of? @method
|
||||
"describe" "it" "before" "after" ; Rspec
|
||||
"namespace" "task" "multitask" "file" ; Rake
|
||||
"setup" "teardown" "should" "should_not" "should_eventually" "context") ; Shoulda
|
||||
"describe" "it" "before" "after" ; Rspec
|
||||
"namespace" "task" "multitask" "file" ; Rake
|
||||
"setup" "teardown" "should" "should_not" "should_eventually" "context")
|
||||
; Shoulda
|
||||
arguments: (argument_list
|
||||
[(string
|
||||
(string_content) @name)
|
||||
(simple_symbol) @name
|
||||
(pair
|
||||
key: [(string (string_content) @name) (hash_key_symbol) @name])
|
||||
(call) @name
|
||||
[
|
||||
(string
|
||||
(string_content) @name)
|
||||
(simple_symbol) @name
|
||||
(pair
|
||||
key: [
|
||||
(string
|
||||
(string_content) @name)
|
||||
(hash_key_symbol) @name
|
||||
])
|
||||
(call) @name
|
||||
])?
|
||||
(#set! "kind" "Method")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Method")) @symbol @selection
|
||||
|
|
|
@ -1,42 +1,34 @@
|
|||
(mod_item
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Module")
|
||||
) @symbol
|
||||
(#set! "kind" "Module")) @symbol
|
||||
|
||||
(enum_item
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
||||
(struct_item
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
||||
(function_item
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(function_signature_item
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(trait_item
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(impl_item
|
||||
trait: (type_identifier)? @trait
|
||||
type: (type_identifier) @rust_type
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(impl_item
|
||||
trait: (type_identifier)? @trait
|
||||
type: (generic_type
|
||||
type: (type_identifier) @rust_type)
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
|
|
@ -1,24 +1,19 @@
|
|||
(trait_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(object_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(class_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(class_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(assignment
|
||||
left: (_) @name
|
||||
(#set! "kind" "Variable")
|
||||
) @symbol
|
||||
(#set! "kind" "Variable")) @symbol
|
||||
|
||||
(rule_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
|
|
@ -1,67 +1,59 @@
|
|||
(contract_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(contract_declaration (_
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol))
|
||||
(contract_declaration
|
||||
(_
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Method")) @symbol))
|
||||
|
||||
(contract_declaration (_
|
||||
(modifier_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol))
|
||||
(contract_declaration
|
||||
(_
|
||||
(modifier_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Method")) @symbol))
|
||||
|
||||
(library_declaration (_
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol))
|
||||
(library_declaration
|
||||
(_
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")) @symbol))
|
||||
|
||||
(interface_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(interface_declaration (_
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol))
|
||||
(interface_declaration
|
||||
(_
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")) @symbol))
|
||||
|
||||
(source_file
|
||||
(function_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol)
|
||||
(#set! "kind" "Function")) @symbol)
|
||||
|
||||
(library_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Module")
|
||||
) @symbol
|
||||
(#set! "kind" "Module")) @symbol
|
||||
|
||||
(enum_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
||||
(event_definition
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Event")
|
||||
) @symbol
|
||||
(#set! "kind" "Event")) @symbol
|
||||
|
||||
(struct_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
||||
(constructor_definition
|
||||
("constructor") @name
|
||||
(#set! "kind" "Constructor")
|
||||
) @symbol
|
||||
"constructor" @name
|
||||
(#set! "kind" "Constructor")) @symbol
|
||||
|
||||
(state_variable_declaration
|
||||
name: (identifier) @name @symbol
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
(function_statement
|
||||
name: [(identifier)] @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(var_declaration
|
||||
(var_declarators
|
||||
|
@ -9,21 +8,18 @@
|
|||
name: (identifier) @name))
|
||||
(expressions
|
||||
(anon_function) @symbol)
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(var_assignment
|
||||
(assignment_variables
|
||||
(var
|
||||
(index
|
||||
(identifier)
|
||||
(identifier) @name)))
|
||||
(expressions
|
||||
(anon_function) @symbol)
|
||||
(#set! "kind" "Function")
|
||||
) @start
|
||||
(assignment_variables
|
||||
(var
|
||||
(index
|
||||
(identifier)
|
||||
(identifier) @name)))
|
||||
(expressions
|
||||
(anon_function) @symbol)
|
||||
(#set! "kind" "Function")) @start
|
||||
|
||||
(function_statement
|
||||
name: (function_name) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
name: (function_name) @name
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -1,97 +1,83 @@
|
|||
(function_signature
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(generator_function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(interface_declaration
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(class_declaration
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(method_definition
|
||||
name: (property_identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(public_field_definition
|
||||
name: (property_identifier) @name
|
||||
value: (arrow_function)
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(type_alias_declaration
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Variable")
|
||||
) @symbol
|
||||
(#set! "kind" "Variable")) @symbol
|
||||
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
name: (identifier) @name
|
||||
value: (_) @var_type) @symbol
|
||||
(#set! "kind" "Variable")
|
||||
) @start
|
||||
(#set! "kind" "Variable")) @start
|
||||
|
||||
; describe("Unit test")
|
||||
(call_expression
|
||||
function: (identifier) @method @name (#any-of? @method "describe" "it" "test" "afterAll" "afterEach" "beforeAll" "beforeEach")
|
||||
function: (identifier) @method @name
|
||||
(#any-of? @method "describe" "it" "test" "afterAll" "afterEach" "beforeAll" "beforeEach")
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Function")) @symbol @selection
|
||||
|
||||
; test.skip("this test")
|
||||
(call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @method (#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier (#any-of? @modifier "skip" "todo")
|
||||
) @name
|
||||
object: (identifier) @method
|
||||
(#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier
|
||||
(#any-of? @modifier "skip" "todo")) @name
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Function")) @symbol @selection
|
||||
|
||||
; describe.each([])("Test suite")
|
||||
(call_expression
|
||||
function: (call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @method (#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier (#any-of? @modifier "each")
|
||||
) @name
|
||||
)
|
||||
object: (identifier) @method
|
||||
(#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier
|
||||
(#any-of? @modifier "each")) @name)
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Function")) @symbol @selection
|
||||
|
||||
; JSX elements
|
||||
(_
|
||||
[
|
||||
(jsx_opening_element (identifier) @name)
|
||||
]
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
|
||||
(jsx_opening_element
|
||||
(identifier) @name)
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
||||
; Self closing JSX elements
|
||||
(jsx_self_closing_element
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Struct")
|
||||
) @symbol
|
||||
(#set! "kind" "Struct")) @symbol
|
||||
|
|
|
@ -1,82 +1,72 @@
|
|||
(function_signature
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(generator_function_declaration
|
||||
name: (identifier) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(interface_declaration
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(class_declaration
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(method_definition
|
||||
name: (property_identifier) @name
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(public_field_definition
|
||||
name: (property_identifier) @name
|
||||
value: (arrow_function)
|
||||
(#set! "kind" "Method")
|
||||
) @symbol
|
||||
(#set! "kind" "Method")) @symbol
|
||||
|
||||
(type_alias_declaration
|
||||
name: (type_identifier) @name
|
||||
(#set! "kind" "Variable")
|
||||
) @symbol
|
||||
(#set! "kind" "Variable")) @symbol
|
||||
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
name: (identifier) @name
|
||||
value: (_) @var_type) @symbol
|
||||
(#set! "kind" "Variable")
|
||||
) @start
|
||||
(#set! "kind" "Variable")) @start
|
||||
|
||||
; describe("Unit test")
|
||||
(call_expression
|
||||
function: (identifier) @method @name (#any-of? @method "describe" "it" "test" "afterAll" "afterEach" "beforeAll" "beforeEach")
|
||||
function: (identifier) @method @name
|
||||
(#any-of? @method "describe" "it" "test" "afterAll" "afterEach" "beforeAll" "beforeEach")
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Function")) @symbol @selection
|
||||
|
||||
; test.skip("this test")
|
||||
(call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @method (#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier (#any-of? @modifier "skip" "todo")
|
||||
) @name
|
||||
object: (identifier) @method
|
||||
(#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier
|
||||
(#any-of? @modifier "skip" "todo")) @name
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Function")) @symbol @selection
|
||||
|
||||
; describe.each([])("Test suite")
|
||||
(call_expression
|
||||
function: (call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @method (#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier (#any-of? @modifier "each")
|
||||
) @name
|
||||
)
|
||||
object: (identifier) @method
|
||||
(#any-of? @method "describe" "it" "test")
|
||||
property: (property_identifier) @modifier
|
||||
(#any-of? @modifier "each")) @name)
|
||||
arguments: (arguments
|
||||
(string
|
||||
(string_fragment) @name @string))?
|
||||
(#set! "kind" "Function")
|
||||
) @symbol @selection
|
||||
(#set! "kind" "Function")) @symbol @selection
|
||||
|
|
|
@ -1,37 +1,42 @@
|
|||
(prim_definition
|
||||
(string) @name
|
||||
(#offset! @name 0 1 0 -1)
|
||||
(#set! "kind" "Class")
|
||||
) @symbol
|
||||
(#set! "kind" "Class")) @symbol
|
||||
|
||||
(attribute_assignment
|
||||
[(identifier) (qualified_identifier)] @name
|
||||
(#set! "kind" "Property")
|
||||
) @symbol
|
||||
[
|
||||
(identifier)
|
||||
(qualified_identifier)
|
||||
] @name
|
||||
(#set! "kind" "Property")) @symbol
|
||||
|
||||
(attribute_declaration
|
||||
[(identifier) (qualified_identifier)] @name
|
||||
(#set! "kind" "Property")
|
||||
) @symbol
|
||||
[
|
||||
(identifier)
|
||||
(qualified_identifier)
|
||||
] @name
|
||||
(#set! "kind" "Property")) @symbol
|
||||
|
||||
(relationship_assignment
|
||||
[(identifier) (qualified_identifier)] @name
|
||||
(#set! "kind" "Property")
|
||||
) @symbol
|
||||
[
|
||||
(identifier)
|
||||
(qualified_identifier)
|
||||
] @name
|
||||
(#set! "kind" "Property")) @symbol
|
||||
|
||||
(relationship_declaration
|
||||
[(identifier) (qualified_identifier)] @name
|
||||
(#set! "kind" "Property")
|
||||
) @symbol
|
||||
[
|
||||
(identifier)
|
||||
(qualified_identifier)
|
||||
] @name
|
||||
(#set! "kind" "Property")) @symbol
|
||||
|
||||
(variant_set_definition
|
||||
(string) @name
|
||||
(#offset! @name 0 1 0 -1)
|
||||
(#set! "kind" "Enum")
|
||||
) @symbol
|
||||
(#set! "kind" "Enum")) @symbol
|
||||
|
||||
(variant
|
||||
(string) @name
|
||||
(#offset! @name 0 1 0 -1)
|
||||
(#set! "kind" "EnumMember")
|
||||
) @symbol
|
||||
(#set! "kind" "EnumMember")) @symbol
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
(function_definition
|
||||
(function_declaration
|
||||
name: [(identifier) (scoped_identifier)] @name)
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
name: [
|
||||
(identifier)
|
||||
(scoped_identifier)
|
||||
] @name)
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(function_definition
|
||||
(function_declaration
|
||||
name: (field_expression) @name)
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
(h1
|
||||
(word)+ @name @start
|
||||
(tag)
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(h2
|
||||
(word)+ @name @start
|
||||
(tag)
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
||||
(tag
|
||||
text: (word) @name
|
||||
(#set! "kind" "Interface")
|
||||
) @symbol
|
||||
(#set! "kind" "Interface")) @symbol
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
(block_mapping_pair
|
||||
key: (flow_node) @name
|
||||
value: (block_node (block_mapping) @symbol)
|
||||
(#set! "kind" "Class")
|
||||
) @start
|
||||
key: (flow_node) @name
|
||||
value: (block_node
|
||||
(block_mapping) @symbol)
|
||||
(#set! "kind" "Class")) @start
|
||||
|
||||
(block_mapping_pair
|
||||
key: (flow_node) @name
|
||||
value: (block_node (block_sequence) @symbol)
|
||||
(#set! "kind" "Enum")
|
||||
) @start
|
||||
key: (flow_node) @name
|
||||
value: (block_node
|
||||
(block_sequence) @symbol)
|
||||
(#set! "kind" "Enum")) @start
|
||||
|
|
|
@ -1,32 +1,27 @@
|
|||
(Decl
|
||||
(VarDecl
|
||||
variable_type_function: (IDENTIFIER) @name
|
||||
(#set! "kind" "Struct")
|
||||
(VarDecl
|
||||
variable_type_function: (IDENTIFIER) @name
|
||||
(#set! "kind" "Struct")
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(ContainerDecl
|
||||
(ContainerDeclType "struct") @symbol
|
||||
))))
|
||||
)
|
||||
(ContainerDecl
|
||||
(ContainerDeclType
|
||||
"struct") @symbol)))))
|
||||
|
||||
(Decl
|
||||
(VarDecl
|
||||
variable_type_function: (IDENTIFIER) @name
|
||||
(#set! "kind" "Struct")
|
||||
(VarDecl
|
||||
variable_type_function: (IDENTIFIER) @name
|
||||
(#set! "kind" "Struct")
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(ContainerDecl
|
||||
(ContainerDeclType "union") @symbol
|
||||
))))
|
||||
)
|
||||
(ContainerDecl
|
||||
(ContainerDeclType
|
||||
"union") @symbol)))))
|
||||
|
||||
(FnProto
|
||||
function: (IDENTIFIER) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
||||
(TestDecl
|
||||
(STRINGLITERALSINGLE) @name
|
||||
(#set! "kind" "Function")
|
||||
) @symbol
|
||||
(#set! "kind" "Function")) @symbol
|
||||
|
|
Loading…
Reference in a new issue