-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
922 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
;; Support for high-level text objects selections. | ||
;; For instance: | ||
;; maf (v)isually select (a) (f)unction or subprogram | ||
;; mif (v)isually select (i)nside a (f)unction or subprogram | ||
;; mai (v)isually select (a) (i)f statement (or loop) | ||
;; mii (v)isually select (i)nside an (i)f statement (or loop) | ||
;; | ||
;; For navigations using textobjects, check link below: | ||
;; https://docs.helix-editor.com/master/usage.html#navigating-using-tree-sitter-textobjects | ||
;; | ||
;; For Textobject queries explaination, check out link below: | ||
;; https://docs.helix-editor.com/master/guides/textobject.html | ||
|
||
(subprogram_body) @function.outer | ||
(subprogram_body (non_empty_declarative_part) @function.inner) | ||
(subprogram_body (handled_sequence_of_statements) @function.inner) | ||
(function_specification) @function.outer | ||
(procedure_specification) @function.outer | ||
(package_declaration) @function.outer | ||
(generic_package_declaration) @function.outer | ||
(package_body) @function.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(struct (_) @function.inner) @funtion.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ | |
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
||
(array | ||
(_) @entry.outer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,73 @@ | ||
; inherits: rust | ||
(function_item | ||
body: (_) @function.inner) @function.outer | ||
|
||
(struct_item | ||
body: (_) @class.inner) @class.outer | ||
|
||
(enum_item | ||
body: (_) @class.inner) @class.outer | ||
|
||
(trait_item | ||
body: (_) @class.inner) @class.outer | ||
|
||
(impl_item | ||
body: (_) @class.inner) @class.outer | ||
|
||
(parameters | ||
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer) | ||
|
||
(type_parameters | ||
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer) | ||
|
||
(type_arguments | ||
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer) | ||
|
||
(arguments | ||
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer) | ||
|
||
(field_initializer_list | ||
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer) | ||
|
||
[ | ||
(line_comment) | ||
] @comment.inner | ||
|
||
(line_comment)+ @comment.outer | ||
|
||
(; #[test] | ||
(attribute_item | ||
(attribute | ||
(identifier) @_test_attribute)) | ||
; allow other attributes like #[should_panic] and comments | ||
[ | ||
(attribute_item) | ||
(line_comment) | ||
]* | ||
; the test function | ||
(function_item | ||
body: (_) @test.inner) @test.outer | ||
(#equal @_test_attribute "test")) | ||
|
||
(array_expression | ||
(_) @entry.outer) | ||
|
||
(tuple_expression | ||
(_) @entry.outer) | ||
|
||
(tuple_pattern | ||
(_) @entry.outer) | ||
|
||
; Commonly used vec macro intializer is special cased | ||
(macro_invocation | ||
(identifier) @_id (token_tree (_) @entry.outer) | ||
(#equal @_id "array")) | ||
|
||
(enum_variant) @entry.outer | ||
|
||
(field_declaration | ||
(_) @entry.inner) @entry.outer | ||
|
||
(field_initializer | ||
(_) @entry.inner) @entry.outer | ||
|
||
(shorthand_field_initializer) @entry.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
(class_definition | ||
body: (_) @class.inner) @class.outer | ||
|
||
(mixin_declaration | ||
(class_body) @class.inner) @class.outer | ||
|
||
(extension_declaration | ||
(extension_body) @class.inner) @class.outer | ||
|
||
(enum_declaration | ||
body: (_) @class.inner) @class.outer | ||
|
||
(type_alias) @class.outer | ||
|
||
(_ | ||
( | ||
[ | ||
(getter_signature) | ||
(setter_signature) | ||
(function_signature) | ||
(method_signature) | ||
(constructor_signature) | ||
] | ||
. | ||
(function_body) @function.inner @function.outer | ||
) @function.outer | ||
) | ||
|
||
(declaration | ||
[ | ||
(constant_constructor_signature) | ||
(constructor_signature) | ||
(factory_constructor_signature) | ||
(redirecting_factory_constructor_signature) | ||
(getter_signature) | ||
(setter_signature) | ||
(operator_signature) | ||
(function_signature) | ||
] | ||
) @function.outer | ||
|
||
(lambda_expression | ||
body: (_) @function.inner | ||
) @function.outer | ||
|
||
(function_expression | ||
body: (_) @function.inner | ||
) @function.outer | ||
|
||
[ | ||
(comment) | ||
(documentation_comment) | ||
] @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
||
(documentation_comment)+ @comment.outer | ||
|
||
(formal_parameter_list | ||
( | ||
(formal_parameter) @parameter.inner . ","? @parameter.outer | ||
) @parameter.outer | ||
) | ||
|
||
(optional_formal_parameters | ||
( | ||
(formal_parameter) @parameter.inner . ","? @parameter.outer | ||
) @parameter.outer | ||
) | ||
|
||
(arguments | ||
( | ||
[ | ||
(argument) @parameter.inner | ||
(named_argument (label) . (_)* @parameter.inner) | ||
] | ||
. ","? @parameter.outer | ||
) @parameter.outer | ||
) | ||
|
||
(type_arguments | ||
( | ||
((_) . ("." . (_) @parameter.inner @parameter.outer)?) @parameter.inner | ||
. ","? @parameter.outer | ||
) @parameter.outer | ||
) | ||
|
||
(expression_statement | ||
((identifier) @_name (#any-of? @_name "test" "testWidgets")) | ||
. | ||
(selector (argument_part (arguments . (_) . (argument) @test.inner))) | ||
) @test.outer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
; inherits: yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(target (block) @function.inner) @function.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
||
(variable_assignment | ||
(_) @entry.inner) @entry.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
||
(variable | ||
(_) @entry.inner) @entry.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
; inherits: _gjs,_javascript,ecma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(section | ||
(identifier) | ||
(_) | ||
(property) @class.inner | ||
) @class.outer | ||
|
||
(attribute | ||
(identifier) | ||
(_) @parameter.inner) @parameter.outer | ||
|
||
(property | ||
(path) | ||
(_) @entry.inner) @entry.outer | ||
|
||
(pair | ||
(_) @entry.inner) @entry.outer | ||
|
||
(array | ||
(_) @entry.outer) | ||
|
||
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(type_definition) @class.outer | ||
|
||
(executable_definition) @function.outer | ||
|
||
(arguments_definition | ||
(input_value_definition) @parameter.inner @parameter.movement) | ||
|
||
(arguments | ||
(argument) @parameter.inner @parameter.movement) | ||
|
||
(selection | ||
[(field) (fragment_spread)] @entry.outer) | ||
|
||
(selection | ||
(field (selection_set) @entry.inner)) | ||
|
||
(field_definition | ||
(_) @entry.inner) @entry.outer | ||
|
||
(input_fields_definition | ||
(input_value_definition ) @entry.outer) | ||
|
||
(enum_value) @entry.outer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
; inherits: _gjs,_typescript,ecma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(comment) @comment.inner | ||
(comment)+ @comment.outer | ||
|
||
(function_arguments | ||
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer) | ||
|
||
(attribute | ||
(_) @entry.inner) @entry.outer | ||
|
||
(tuple | ||
(_) @entry.outer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
||
(pair | ||
(_) @entry.inner) @entry.outer | ||
|
||
(array | ||
(_) @entry.outer) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(comment) @comment.inner | ||
|
||
(comment)+ @comment.outer | ||
|
||
(entry (_) @function.inner) @function.outer |
Oops, something went wrong.