lint: autoformat all tree-sitter query files

This commit is contained in:
Steven Arcangeli 2024-06-01 20:50:39 -07:00
parent 690290be7f
commit 75de06f8ed
37 changed files with 483 additions and 553 deletions

View file

@ -1,4 +1,3 @@
(function_definition (function_definition
name: (word) @name name: (word) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol

View file

@ -1,22 +1,17 @@
(type_definition (type_definition
type: (enum_specifier) @symbol type: (enum_specifier) @symbol
declarator: (type_identifier) @name declarator: (type_identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @start
) @start
(type_definition (type_definition
type: (struct_specifier) @symbol type: (struct_specifier) @symbol
declarator: (type_identifier) @name declarator: (type_identifier) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")) @start
) @start
( ((declaration) @root @start
(declaration) @root @start
. .
(function_definition) @symbol @end (function_definition) @symbol @end
(#set! "kind" "Function") (#set! "kind" "Function"))
)
(function_definition (function_definition
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @root
) @symbol @root

View file

@ -1,41 +1,33 @@
(interface_declaration (interface_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(class_declaration (class_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(struct_declaration (struct_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")) @symbol
) @symbol
(method_declaration (method_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(enum_declaration (enum_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol
(constructor_declaration (constructor_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Constructor") (#set! "kind" "Constructor")) @symbol
) @symbol
(property_declaration (property_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Property") (#set! "kind" "Property")) @symbol
) @symbol
(field_declaration (field_declaration
(variable_declaration (variable_declaration
(variable_declarator (variable_declarator
(identifier) @name)) (identifier) @name))
(#set! "kind" "Field") (#set! "kind" "Field")) @symbol
) @symbol

View file

@ -1,28 +1,22 @@
(struct_specifier (struct_specifier
name: (type_identifier) @name name: (type_identifier) @name
body: (field_declaration_list) body: (field_declaration_list)
(#set! "kind" "Struct") (#set! "kind" "Struct")) @symbol
) @symbol
(declaration (declaration
(struct_specifier (struct_specifier
body: (field_declaration_list) body: (field_declaration_list)) @symbol
) @symbol
declarator: (identifier) @name declarator: (identifier) @name
(#set! "kind" "Struct") (#set! "kind" "Struct"))
)
(function_declarator (function_declarator
declarator: (_) @name declarator: (_) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(enum_specifier (enum_specifier
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol
(class_specifier (class_specifier
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol

View file

@ -1,37 +1,30 @@
(class_definition (class_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(constructor_signature (constructor_signature
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Constructor") (#set! "kind" "Constructor")) @symbol
) @symbol
( ((method_signature
(method_signature [
[(function_signature (function_signature
name: (identifier) @name) name: (identifier) @name)
(getter_signature (getter_signature
name: (identifier) @name) name: (identifier) @name)
(setter_signature (setter_signature
name: (identifier) @name) name: (identifier) @name)
] ]) @symbol
) @symbol
. .
(function_body) @end (function_body) @end
(#set! "kind" "Method") (#set! "kind" "Method"))
)
( ((function_signature
(function_signature name: (identifier) @name) @symbol
name: (identifier) @name) @symbol
. .
(function_body) @end (function_body) @end
(#set! "kind" "Function") (#set! "kind" "Function"))
)
(enum_declaration (enum_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol

View file

@ -1,75 +1,83 @@
(call (call
target: (identifier) @identifier (#any-of? @identifier "defmodule" "defprotocol") target: (identifier) @identifier
(#any-of? @identifier "defmodule" "defprotocol")
(arguments) @name (arguments) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(call (call
target: (identifier) @identifier (#eq? @identifier "defimpl") target: (identifier) @identifier
(#eq? @identifier "defimpl")
(arguments (arguments
(alias) @protocol (alias) @protocol
(keywords (pair (keywords
key: (keyword) @kw (#match? @kw "^for:") (pair
value: (alias) @name)) key: (keyword) @kw
) (#match? @kw "^for:")
(#set! "kind" "Function") value: (alias) @name)))
) @symbol (#set! "kind" "Function")) @symbol
(call (call
target: (identifier) @identifier (#any-of? @identifier "def" "defp" "defguard" "defmacro" "defmacrop") target: (identifier) @identifier
(arguments [ (#any-of? @identifier "def" "defp" "defguard" "defmacro" "defmacrop")
(call target: (identifier) @name) (arguments
(binary_operator left: (call target: (identifier) @name)) [
((identifier) @name) (call
]) target: (identifier) @name)
(#set! "kind" "Function") (binary_operator
) @symbol left: (call
target: (identifier) @name))
(identifier) @name
])
(#set! "kind" "Function")) @symbol
(unary_operator (unary_operator
operator: "@" operator: "@"
operand: (call operand: (call
target: (identifier) @identifier (#any-of? @identifier "callback" "spec") target: (identifier) @identifier
(arguments [ (#any-of? @identifier "callback" "spec")
(call target: (identifier) @name) (arguments
(binary_operator left: (call target: (identifier) @name)) [
])) (call
@symbol target: (identifier) @name)
(#set! "kind" "Function") (binary_operator
) @start left: (call
target: (identifier) @name))
])) @symbol
(#set! "kind" "Function")) @start
(unary_operator (unary_operator
operator: "@" operator: "@"
operand: (call operand: (call
target: (identifier) @identifier (#eq? @identifier "module_attribute") target: (identifier) @identifier
(arguments) @name (#eq? @identifier "module_attribute")
) @symbol (arguments) @name) @symbol
(#set! "kind" "Function") (#set! "kind" "Function")) @start
) @start
(unary_operator (unary_operator
operator: "@" operator: "@"
operand: (call target: (identifier) @name (#not-any-of? @name "module_attribute" "callback" "spec" "doc" "moduledoc")) @symbol operand: (call
(#set! "kind" "Constant") target: (identifier) @name
) @start (#not-any-of? @name "module_attribute" "callback" "spec" "doc" "moduledoc")) @symbol
(#set! "kind" "Constant")) @start
(do_block (do_block
(call (call
target: (identifier) @identifier (#eq? @identifier "defstruct")) @symbol target: (identifier) @identifier
(#set! "kind" "Function") (#eq? @identifier "defstruct")) @symbol
) @start (#set! "kind" "Function")) @start
; exunit unit test ; exunit unit test
(call (call
target: (identifier) @identifier (#any-of? @identifier "describe" "test") target: (identifier) @identifier
(arguments [(string (quoted_content) @name)]) (#any-of? @identifier "describe" "test")
(#set! "kind" "Function") (arguments
) @symbol (string
(quoted_content) @name))
(#set! "kind" "Function")) @symbol
; exunit test setup ; exunit test setup
(do_block (do_block
(call (call
target: (identifier) @identifier @name (#eq? @identifier "setup")) @symbol target: (identifier) @identifier @name
(#set! "kind" "Function") (#eq? @identifier "setup")) @symbol
) @symbol (#set! "kind" "Function")) @symbol

View file

@ -1,24 +1,20 @@
(function_declaration (function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(type_declaration (type_declaration
(type_spec (type_spec
name: (type_identifier) @name name: (type_identifier) @name
type: (struct_type) @symbol) type: (struct_type) @symbol)
(#set! "kind" "Struct") (#set! "kind" "Struct")) @start
) @start
(type_declaration (type_declaration
(type_spec (type_spec
name: (type_identifier) @name name: (type_identifier) @name
type: (interface_type) @symbol) type: (interface_type) @symbol)
(#set! "kind" "Interface") (#set! "kind" "Interface")) @start
) @start
(method_declaration (method_declaration
receiver: (_) @receiver receiver: (_) @receiver
name: (field_identifier) @name name: (field_identifier) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol

View file

@ -1,22 +1,23 @@
(juxt_function_call (juxt_function_call
function: (identifier) @name (#not-any-of? @name "else" "try" "exec") function: (identifier) @name
(argument_list (closure)) (#not-any-of? @name "else" "try" "exec")
(#set! "kind" "Module") (argument_list
) @symbol (closure))
(#set! "kind" "Module")) @symbol
(declaration (declaration
name: (identifier) @name name: (identifier) @name
(closure) (closure)
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(juxt_function_call (juxt_function_call
function: (identifier) @keyword (#eq? @keyword "task") function: (identifier) @keyword
(argument_list ((function_call function: (identifier) @name))) (#eq? @keyword "task")
(#set! "kind" "Function") (argument_list
) @symbol (function_call
function: (identifier) @name))
(#set! "kind" "Function")) @symbol
(declaration (declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Constant") (#set! "kind" "Constant")) @symbol
) @symbol

View file

@ -3,16 +3,13 @@
(h1 (h1
(word)+ @name @start (word)+ @name @start
(tag) (tag)
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(h2 (h2
(word)+ @name @start (word)+ @name @start
(tag) (tag)
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(tag (tag
text: (word) @name text: (word) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol

View file

@ -1,15 +1,15 @@
((doctype) @name ((doctype) @name
(#set! "kind" "Module") (#set! "kind" "Module")) @symbol
) @symbol
(_ (_
[ [
(start_tag (tag_name) @name) (start_tag
(self_closing_tag (tag_name) @name) (tag_name) @name)
(self_closing_tag
(tag_name) @name)
] ]
(#set! "kind" "Struct") (#set! "kind" "Struct")) @symbol
) @symbol
(attribute (attribute_name) @name (attribute
(#set! "kind" "Field") (attribute_name) @name
) @symbol (#set! "kind" "Field")) @symbol

View file

@ -1,30 +1,24 @@
(interface_declaration (interface_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(method_declaration (method_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(constructor_declaration (constructor_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Constructor") (#set! "kind" "Constructor")) @symbol
) @symbol
(class_declaration (class_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(enum_declaration (enum_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol
(field_declaration (field_declaration
declarator: (variable_declarator declarator: (variable_declarator
name: (identifier) @name) name: (identifier) @name)
(#set! "kind" "Field") (#set! "kind" "Field")) @symbol
) @symbol

View file

@ -1,69 +1,65 @@
(class_declaration (class_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(function_declaration (function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(generator_function_declaration (generator_function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(method_definition (method_definition
name: (property_identifier) @name name: (property_identifier) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(field_definition (field_definition
property: (property_identifier) @name property: (property_identifier) @name
value: (arrow_function) value: (arrow_function)
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
; const fn = () => {} ; const fn = () => {}
(lexical_declaration (lexical_declaration
(variable_declarator (variable_declarator
name: (identifier) @name name: (identifier) @name
value: [(arrow_function) (function_expression) (generator_function)] @symbol value: [
) (arrow_function)
(#set! "kind" "Function") (function_expression)
) @start (generator_function)
] @symbol)
(#set! "kind" "Function")) @start
; describe("Unit test") ; describe("Unit test")
(call_expression (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 arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
; test.skip("this test") ; test.skip("this test")
(call_expression (call_expression
function: (member_expression function: (member_expression
object: (identifier) @method (#any-of? @method "describe" "it" "test") object: (identifier) @method
property: (property_identifier) @modifier (#any-of? @modifier "skip" "todo") (#any-of? @method "describe" "it" "test")
) @name property: (property_identifier) @modifier
(#any-of? @modifier "skip" "todo")) @name
arguments: (arguments arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
; describe.each([])("Test suite") ; describe.each([])("Test suite")
(call_expression (call_expression
function: (call_expression function: (call_expression
function: (member_expression function: (member_expression
object: (identifier) @method (#any-of? @method "describe" "it" "test") object: (identifier) @method
property: (property_identifier) @modifier (#any-of? @modifier "each") (#any-of? @method "describe" "it" "test")
) @name property: (property_identifier) @modifier
) (#any-of? @modifier "each")) @name)
arguments: (arguments arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol

View file

@ -2,5 +2,4 @@
key: (string key: (string
(string_content) @name) (string_content) @name)
value: (object) @symbol value: (object) @symbol
(#set! "kind" "Class") (#set! "kind" "Class")) @start
) @start

View file

@ -1,45 +1,38 @@
(module_definition (module_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Module") (#set! "kind" "Module")) @symbol
) @symbol
(function_definition (function_definition
(signature (signature
((call_expression) @name)) (call_expression) @name)
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(assignment (assignment
. .
(where_expression (where_expression
((call_expression) @name)) (call_expression) @name)
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(assignment (assignment
. .
((call_expression) @name) (call_expression) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(abstract_definition (abstract_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(struct_definition (struct_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(const_statement (const_statement
(assignment (assignment
. (identifier) @name) .
(#set! "kind" "Constant") (identifier) @name)
) @symbol (#set! "kind" "Constant")) @symbol
(macro_definition (macro_definition
(signature (signature
((call_expression) @name)) (call_expression) @name)
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol

View file

@ -1,32 +1,56 @@
(section (section
text: [(curly_group (text) @name) (_)] @name text: [
(#set! "kind" "Method") (curly_group
) @symbol (text) @name)
(_)
] @name
(#set! "kind" "Method")) @symbol
(subsection (subsection
text: [(curly_group (text) @name) (_)] @name text: [
(#set! "kind" "Method") (curly_group
) @symbol (text) @name)
(_)
] @name
(#set! "kind" "Method")) @symbol
(subsubsection (subsubsection
text: [(curly_group (text) @name) (_)] @name text: [
(#set! "kind" "Method") (curly_group
) @symbol (text) @name)
(_)
] @name
(#set! "kind" "Method")) @symbol
(generic_environment (generic_environment
begin: (begin begin: (begin
name: [(curly_group_text text: (text) @name) (_)] @name name: [
) (curly_group_text
(#set! "kind" "Class") text: (text) @name)
) @symbol (_)
] @name)
(#set! "kind" "Class")) @symbol
(new_command_definition (new_command_definition
declaration: [(curly_group_command_name command: (command_name) @name) (_)] @name declaration: [
(#set! "kind" "Operator") (curly_group_command_name
) @symbol command: (command_name) @name)
(_)
] @name
(#set! "kind" "Operator")) @symbol
(title_declaration (title_declaration
text: [(curly_group (text) @name) (_)] @name text: [
(#set! "kind" "Field") (curly_group
) @symbol (text) @name)
(_)
] @name
(#set! "kind" "Field")) @symbol
(author_declaration (author_declaration
authors: [(curly_group_author_list (author) @name) (_)] @name authors: [
(#set! "kind" "Field") (curly_group_author_list
) @symbol (author) @name)
(_)
] @name
(#set! "kind" "Field")) @symbol

View file

@ -1,46 +1,53 @@
(function_declaration (function_declaration
name: [(identifier) (dot_index_expression) (method_index_expression)] @name name: [
(#set! "kind" "Function") (identifier)
) @symbol (dot_index_expression)
(method_index_expression)
] @name
(#set! "kind" "Function")) @symbol
(variable_declaration (variable_declaration
(assignment_statement (assignment_statement
(variable_list (variable_list
name: [(identifier) (dot_index_expression)] @name) name: [
(identifier)
(dot_index_expression)
] @name)
(expression_list (expression_list
value: (function_definition) @symbol)) value: (function_definition) @symbol))
(#set! "kind" "Function") (#set! "kind" "Function")) @start
) @start
(assignment_statement (assignment_statement
(variable_list (variable_list
name: [(identifier) (dot_index_expression) (bracket_index_expression)] @name) name: [
(identifier)
(dot_index_expression)
(bracket_index_expression)
] @name)
(expression_list (expression_list
value: (function_definition) @symbol) value: (function_definition) @symbol)
(#set! "kind" "Function") (#set! "kind" "Function")) @start
) @start
(field (field
name: (identifier) @name name: (identifier) @name
value: (function_definition) @symbol value: (function_definition) @symbol
(#set! "kind" "Function") (#set! "kind" "Function")) @start
) @start
(function_call (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 arguments: (arguments
(string)? @name (string)? @name
(function_definition) @symbol) (function_definition) @symbol)
(#set! "kind" "Function") (#set! "kind" "Function")) @start @selection
) @start @selection
(function_call (function_call
name: (dot_index_expression name: (dot_index_expression
table: (identifier) @tbl (#match? @tbl "^a") table: (identifier) @tbl
field: (identifier) @method @name (#any-of? @method "describe" "it" "before_each" "after_each") (#match? @tbl "^a")
) field: (identifier) @method @name
(#any-of? @method "describe" "it" "before_each" "after_each"))
arguments: (arguments arguments: (arguments
(string)? @name (string)? @name
(function_definition) @symbol) (function_definition) @symbol)
(#set! "kind" "Function") (#set! "kind" "Function")) @start @selection
) @start @selection

View file

@ -1,4 +1,3 @@
(rule (rule
(targets) @name (targets) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol

View file

@ -1,11 +1,19 @@
(atx_heading (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 heading_content: (_) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(setext_heading (setext_heading
heading_content: (_) @name heading_content: (_) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")
[(setext_h1_underline) (setext_h2_underline)] @level [
) @symbol (setext_h1_underline)
(setext_h2_underline)
] @level) @symbol

View file

@ -1,36 +1,30 @@
;; Headings ; Headings
((heading1 ((heading1
(heading1_prefix) (heading1_prefix)
title: (paragraph_segment) @name) @symbol title: (paragraph_segment) @name) @symbol
(#set! "kind" "Interface") (#set! "kind" "Interface"))
)
((heading2 ((heading2
(heading2_prefix) (heading2_prefix)
title: (paragraph_segment) @name) @symbol title: (paragraph_segment) @name) @symbol
(#set! "kind" "Interface") (#set! "kind" "Interface"))
)
((heading3 ((heading3
(heading3_prefix) (heading3_prefix)
title: (paragraph_segment) @name) @symbol title: (paragraph_segment) @name) @symbol
(#set! "kind" "Interface") (#set! "kind" "Interface"))
)
((heading4 ((heading4
(heading4_prefix) (heading4_prefix)
title: (paragraph_segment) @name) @symbol title: (paragraph_segment) @name) @symbol
(#set! "kind" "Interface") (#set! "kind" "Interface"))
)
((heading5 ((heading5
(heading5_prefix) (heading5_prefix)
title: (paragraph_segment) @name) @symbol title: (paragraph_segment) @name) @symbol
(#set! "kind" "Interface") (#set! "kind" "Interface"))
)
((heading6 ((heading6
(heading6_prefix) (heading6_prefix)
title: (paragraph_segment) @name) @symbol title: (paragraph_segment) @name) @symbol
(#set! "kind" "Interface") (#set! "kind" "Interface"))
)

View file

@ -1,5 +1,4 @@
(section (section
(headline (headline
item: (item) @name) item: (item) @name)
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol

View file

@ -1,32 +1,25 @@
(function_definition (function_definition
name: (name) @name name: (name) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(expression_statement (expression_statement
(assignment_expression (assignment_expression
left: (variable_name) @name left: (variable_name) @name
right: (anonymous_function_creation_expression) @symbol right: (anonymous_function_creation_expression) @symbol)
) (#set! "kind" "Function")) @start
(#set! "kind" "Function")
) @start
(class_declaration (class_declaration
name: (name) @name name: (name) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(method_declaration (method_declaration
name: (name) @name name: (name) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(interface_declaration (interface_declaration
name: (name) @name name: (name) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(trait_declaration (trait_declaration
name: (name) @name name: (name) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol

View file

@ -1,9 +1,7 @@
(message (message
(message_name) @name (message_name) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(enum (enum
(enum_name) @name (enum_name) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol

View file

@ -1,14 +1,11 @@
(function_definition (function_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(class_definition (class_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(assignment (assignment
left: (_) @name left: (_) @name
(#set! "kind" "Variable") (#set! "kind" "Variable")) @symbol
) @symbol

View file

@ -1,4 +1,3 @@
(section (section
(title) @name (title) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol

View file

@ -1,66 +1,76 @@
(class (class
name: [(constant) (scope_resolution)] @name name: [
(#set! "kind" "Class") (constant)
) @symbol (scope_resolution)
] @name
(#set! "kind" "Class")) @symbol
(call (call
( ((identifier) @scope
(identifier) @scope (#any-of? @scope "private" "protected" "public"))?
(#any-of? @scope "private" "protected" "public")
)?
. .
(argument_list (argument_list
(method (method
name: (_) @name name: (_) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol))
) @symbol
)
)
(body_statement (body_statement
[ [
(_) (_)
((identifier) @scope ((identifier) @scope
(#any-of? @scope "private" "protected" "public")) (#any-of? @scope "private" "protected" "public"))
]* ]*
. .
(method (method
name: (_) @name name: (_) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol)
) @symbol
)
(singleton_method (singleton_method
object: [(constant) (self) (identifier)] @receiver object: [
(["." "::"] @separator)? (constant)
name: [(operator) (identifier)] @name (self)
(#set! "kind" "Method") (identifier)
) @symbol ] @receiver
([
"."
"::"
] @separator)?
name: [
(operator)
(identifier)
] @name
(#set! "kind" "Method")) @symbol
(singleton_class (singleton_class
value: (_) @name value: (_) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(module (module
name: [(constant) (scope_resolution)] @name name: [
(#set! "kind" "Module") (constant)
) @symbol (scope_resolution)
] @name
(#set! "kind" "Module")) @symbol
; For Rspec, Rake, and Shoulda ; For Rspec, Rake, and Shoulda
(call (call
method: (identifier) @method @name method: (identifier) @method @name
(#any-of? @method (#any-of? @method
"describe" "it" "before" "after" ; Rspec "describe" "it" "before" "after" ; Rspec
"namespace" "task" "multitask" "file" ; Rake "namespace" "task" "multitask" "file" ; Rake
"setup" "teardown" "should" "should_not" "should_eventually" "context") ; Shoulda "setup" "teardown" "should" "should_not" "should_eventually" "context")
; Shoulda
arguments: (argument_list arguments: (argument_list
[(string [
(string_content) @name) (string
(simple_symbol) @name (string_content) @name)
(pair (simple_symbol) @name
key: [(string (string_content) @name) (hash_key_symbol) @name]) (pair
(call) @name key: [
(string
(string_content) @name)
(hash_key_symbol) @name
])
(call) @name
])? ])?
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol @selection
) @symbol @selection

View file

@ -1,42 +1,34 @@
(mod_item (mod_item
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Module") (#set! "kind" "Module")) @symbol
) @symbol
(enum_item (enum_item
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol
(struct_item (struct_item
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")) @symbol
) @symbol
(function_item (function_item
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(function_signature_item (function_signature_item
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(trait_item (trait_item
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(impl_item (impl_item
trait: (type_identifier)? @trait trait: (type_identifier)? @trait
type: (type_identifier) @rust_type type: (type_identifier) @rust_type
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(impl_item (impl_item
trait: (type_identifier)? @trait trait: (type_identifier)? @trait
type: (generic_type type: (generic_type
type: (type_identifier) @rust_type) type: (type_identifier) @rust_type)
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol

View file

@ -1,24 +1,19 @@
(trait_definition (trait_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(object_definition (object_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(class_definition (class_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(function_declaration (function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(function_definition (function_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol

View file

@ -1,19 +1,15 @@
(function_definition (function_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(class_definition (class_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(assignment (assignment
left: (_) @name left: (_) @name
(#set! "kind" "Variable") (#set! "kind" "Variable")) @symbol
) @symbol
(rule_definition (rule_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol

View file

@ -1,67 +1,59 @@
(contract_declaration (contract_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(contract_declaration (_ (contract_declaration
(function_definition (_
name: (identifier) @name (function_definition
(#set! "kind" "Method") name: (identifier) @name
) @symbol)) (#set! "kind" "Method")) @symbol))
(contract_declaration (_ (contract_declaration
(modifier_definition (_
name: (identifier) @name (modifier_definition
(#set! "kind" "Method") name: (identifier) @name
) @symbol)) (#set! "kind" "Method")) @symbol))
(library_declaration (_ (library_declaration
(function_definition (_
name: (identifier) @name (function_definition
(#set! "kind" "Function") name: (identifier) @name
) @symbol)) (#set! "kind" "Function")) @symbol))
(interface_declaration (interface_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(interface_declaration (_ (interface_declaration
(function_definition (_
name: (identifier) @name (function_definition
(#set! "kind" "Function") name: (identifier) @name
) @symbol)) (#set! "kind" "Function")) @symbol))
(source_file (source_file
(function_definition (function_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol)
) @symbol)
(library_declaration (library_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Module") (#set! "kind" "Module")) @symbol
) @symbol
(enum_declaration (enum_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol
(event_definition (event_definition
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Event") (#set! "kind" "Event")) @symbol
) @symbol
(struct_declaration (struct_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")) @symbol
) @symbol
(constructor_definition (constructor_definition
("constructor") @name "constructor" @name
(#set! "kind" "Constructor") (#set! "kind" "Constructor")) @symbol
) @symbol
(state_variable_declaration (state_variable_declaration
name: (identifier) @name @symbol name: (identifier) @name @symbol

View file

@ -1,7 +1,6 @@
(function_statement (function_statement
name: [(identifier)] @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(var_declaration (var_declaration
(var_declarators (var_declarators
@ -9,21 +8,18 @@
name: (identifier) @name)) name: (identifier) @name))
(expressions (expressions
(anon_function) @symbol) (anon_function) @symbol)
(#set! "kind" "Function") (#set! "kind" "Function")) @start
) @start
(var_assignment (var_assignment
(assignment_variables (assignment_variables
(var (var
(index (index
(identifier) (identifier)
(identifier) @name))) (identifier) @name)))
(expressions (expressions
(anon_function) @symbol) (anon_function) @symbol)
(#set! "kind" "Function") (#set! "kind" "Function")) @start
) @start
(function_statement (function_statement
name: (function_name) @name name: (function_name) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol

View file

@ -1,97 +1,83 @@
(function_signature (function_signature
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(function_declaration (function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(generator_function_declaration (generator_function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(interface_declaration (interface_declaration
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(class_declaration (class_declaration
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(method_definition (method_definition
name: (property_identifier) @name name: (property_identifier) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(public_field_definition (public_field_definition
name: (property_identifier) @name name: (property_identifier) @name
value: (arrow_function) value: (arrow_function)
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(type_alias_declaration (type_alias_declaration
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Variable") (#set! "kind" "Variable")) @symbol
) @symbol
(lexical_declaration (lexical_declaration
(variable_declarator (variable_declarator
name: (identifier) @name name: (identifier) @name
value: (_) @var_type) @symbol value: (_) @var_type) @symbol
(#set! "kind" "Variable") (#set! "kind" "Variable")) @start
) @start
; describe("Unit test") ; describe("Unit test")
(call_expression (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 arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @selection
) @symbol @selection
; test.skip("this test") ; test.skip("this test")
(call_expression (call_expression
function: (member_expression function: (member_expression
object: (identifier) @method (#any-of? @method "describe" "it" "test") object: (identifier) @method
property: (property_identifier) @modifier (#any-of? @modifier "skip" "todo") (#any-of? @method "describe" "it" "test")
) @name property: (property_identifier) @modifier
(#any-of? @modifier "skip" "todo")) @name
arguments: (arguments arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @selection
) @symbol @selection
; describe.each([])("Test suite") ; describe.each([])("Test suite")
(call_expression (call_expression
function: (call_expression function: (call_expression
function: (member_expression function: (member_expression
object: (identifier) @method (#any-of? @method "describe" "it" "test") object: (identifier) @method
property: (property_identifier) @modifier (#any-of? @modifier "each") (#any-of? @method "describe" "it" "test")
) @name property: (property_identifier) @modifier
) (#any-of? @modifier "each")) @name)
arguments: (arguments arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @selection
) @symbol @selection
; JSX elements ; JSX elements
(_ (_
[ (jsx_opening_element
(jsx_opening_element (identifier) @name) (identifier) @name)
] (#set! "kind" "Struct")) @symbol
(#set! "kind" "Struct")
) @symbol
; Self closing JSX elements ; Self closing JSX elements
(jsx_self_closing_element (jsx_self_closing_element
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")) @symbol
) @symbol

View file

@ -1,82 +1,72 @@
(function_signature (function_signature
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(function_declaration (function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(generator_function_declaration (generator_function_declaration
name: (identifier) @name name: (identifier) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(interface_declaration (interface_declaration
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(class_declaration (class_declaration
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(method_definition (method_definition
name: (property_identifier) @name name: (property_identifier) @name
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(public_field_definition (public_field_definition
name: (property_identifier) @name name: (property_identifier) @name
value: (arrow_function) value: (arrow_function)
(#set! "kind" "Method") (#set! "kind" "Method")) @symbol
) @symbol
(type_alias_declaration (type_alias_declaration
name: (type_identifier) @name name: (type_identifier) @name
(#set! "kind" "Variable") (#set! "kind" "Variable")) @symbol
) @symbol
(lexical_declaration (lexical_declaration
(variable_declarator (variable_declarator
name: (identifier) @name name: (identifier) @name
value: (_) @var_type) @symbol value: (_) @var_type) @symbol
(#set! "kind" "Variable") (#set! "kind" "Variable")) @start
) @start
; describe("Unit test") ; describe("Unit test")
(call_expression (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 arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @selection
) @symbol @selection
; test.skip("this test") ; test.skip("this test")
(call_expression (call_expression
function: (member_expression function: (member_expression
object: (identifier) @method (#any-of? @method "describe" "it" "test") object: (identifier) @method
property: (property_identifier) @modifier (#any-of? @modifier "skip" "todo") (#any-of? @method "describe" "it" "test")
) @name property: (property_identifier) @modifier
(#any-of? @modifier "skip" "todo")) @name
arguments: (arguments arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @selection
) @symbol @selection
; describe.each([])("Test suite") ; describe.each([])("Test suite")
(call_expression (call_expression
function: (call_expression function: (call_expression
function: (member_expression function: (member_expression
object: (identifier) @method (#any-of? @method "describe" "it" "test") object: (identifier) @method
property: (property_identifier) @modifier (#any-of? @modifier "each") (#any-of? @method "describe" "it" "test")
) @name property: (property_identifier) @modifier
) (#any-of? @modifier "each")) @name)
arguments: (arguments arguments: (arguments
(string (string
(string_fragment) @name @string))? (string_fragment) @name @string))?
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol @selection
) @symbol @selection

View file

@ -1,37 +1,42 @@
(prim_definition (prim_definition
(string) @name (string) @name
(#offset! @name 0 1 0 -1) (#offset! @name 0 1 0 -1)
(#set! "kind" "Class") (#set! "kind" "Class")) @symbol
) @symbol
(attribute_assignment (attribute_assignment
[(identifier) (qualified_identifier)] @name [
(#set! "kind" "Property") (identifier)
) @symbol (qualified_identifier)
] @name
(#set! "kind" "Property")) @symbol
(attribute_declaration (attribute_declaration
[(identifier) (qualified_identifier)] @name [
(#set! "kind" "Property") (identifier)
) @symbol (qualified_identifier)
] @name
(#set! "kind" "Property")) @symbol
(relationship_assignment (relationship_assignment
[(identifier) (qualified_identifier)] @name [
(#set! "kind" "Property") (identifier)
) @symbol (qualified_identifier)
] @name
(#set! "kind" "Property")) @symbol
(relationship_declaration (relationship_declaration
[(identifier) (qualified_identifier)] @name [
(#set! "kind" "Property") (identifier)
) @symbol (qualified_identifier)
] @name
(#set! "kind" "Property")) @symbol
(variant_set_definition (variant_set_definition
(string) @name (string) @name
(#offset! @name 0 1 0 -1) (#offset! @name 0 1 0 -1)
(#set! "kind" "Enum") (#set! "kind" "Enum")) @symbol
) @symbol
(variant (variant
(string) @name (string) @name
(#offset! @name 0 1 0 -1) (#offset! @name 0 1 0 -1)
(#set! "kind" "EnumMember") (#set! "kind" "EnumMember")) @symbol
) @symbol

View file

@ -1,11 +1,12 @@
(function_definition (function_definition
(function_declaration (function_declaration
name: [(identifier) (scoped_identifier)] @name) name: [
(#set! "kind" "Function") (identifier)
) @symbol (scoped_identifier)
] @name)
(#set! "kind" "Function")) @symbol
(function_definition (function_definition
(function_declaration (function_declaration
name: (field_expression) @name) name: (field_expression) @name)
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol

View file

@ -1,16 +1,13 @@
(h1 (h1
(word)+ @name @start (word)+ @name @start
(tag) (tag)
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(h2 (h2
(word)+ @name @start (word)+ @name @start
(tag) (tag)
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol
(tag (tag
text: (word) @name text: (word) @name
(#set! "kind" "Interface") (#set! "kind" "Interface")) @symbol
) @symbol

View file

@ -1,11 +1,11 @@
(block_mapping_pair (block_mapping_pair
key: (flow_node) @name key: (flow_node) @name
value: (block_node (block_mapping) @symbol) value: (block_node
(#set! "kind" "Class") (block_mapping) @symbol)
) @start (#set! "kind" "Class")) @start
(block_mapping_pair (block_mapping_pair
key: (flow_node) @name key: (flow_node) @name
value: (block_node (block_sequence) @symbol) value: (block_node
(#set! "kind" "Enum") (block_sequence) @symbol)
) @start (#set! "kind" "Enum")) @start

View file

@ -1,32 +1,27 @@
(Decl (Decl
(VarDecl (VarDecl
variable_type_function: (IDENTIFIER) @name variable_type_function: (IDENTIFIER) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")
(_
(_ (_
(_ (ContainerDecl
(ContainerDecl (ContainerDeclType
(ContainerDeclType "struct") @symbol "struct") @symbol)))))
))))
)
(Decl (Decl
(VarDecl (VarDecl
variable_type_function: (IDENTIFIER) @name variable_type_function: (IDENTIFIER) @name
(#set! "kind" "Struct") (#set! "kind" "Struct")
(_
(_ (_
(_ (ContainerDecl
(ContainerDecl (ContainerDeclType
(ContainerDeclType "union") @symbol "union") @symbol)))))
))))
)
(FnProto (FnProto
function: (IDENTIFIER) @name function: (IDENTIFIER) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol
(TestDecl (TestDecl
(STRINGLITERALSINGLE) @name (STRINGLITERALSINGLE) @name
(#set! "kind" "Function") (#set! "kind" "Function")) @symbol
) @symbol