update treesitter parsing to accomodate for collapsed nested functions
Co-authored-by: maxbrunsfeld <max@zed.dev>
This commit is contained in:
parent
0e071919a0
commit
9809ec3d70
9 changed files with 773 additions and 584 deletions
|
@ -10,3 +10,4 @@ brackets = [
|
|||
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] },
|
||||
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
||||
collapsed_placeholder = " /* ... */ "
|
||||
|
|
|
@ -1,50 +1,28 @@
|
|||
(
|
||||
(line_comment)* @context
|
||||
[(line_comment) (attribute_item)]* @context
|
||||
.
|
||||
(enum_item
|
||||
name: (_) @name) @item
|
||||
)
|
||||
[
|
||||
(struct_item
|
||||
name: (_) @name)
|
||||
|
||||
(
|
||||
(line_comment)* @context
|
||||
.
|
||||
(struct_item
|
||||
name: (_) @name) @item
|
||||
)
|
||||
(enum_item
|
||||
name: (_) @name)
|
||||
|
||||
(
|
||||
(line_comment)* @context
|
||||
.
|
||||
(impl_item
|
||||
trait: (_)? @name
|
||||
"for"? @name
|
||||
type: (_) @name) @item
|
||||
)
|
||||
(impl_item
|
||||
trait: (_)? @name
|
||||
"for"? @name
|
||||
type: (_) @name)
|
||||
|
||||
(
|
||||
(line_comment)* @context
|
||||
.
|
||||
(trait_item
|
||||
name: (_) @name) @item
|
||||
)
|
||||
(trait_item
|
||||
name: (_) @name)
|
||||
|
||||
(
|
||||
(line_comment)* @context
|
||||
.
|
||||
(function_item
|
||||
name: (_) @name) @item
|
||||
)
|
||||
(function_item
|
||||
name: (_) @name
|
||||
body: (block
|
||||
"{" @keep
|
||||
"}" @keep) @collapse)
|
||||
|
||||
(
|
||||
(line_comment)* @context
|
||||
.
|
||||
(macro_definition
|
||||
name: (_) @name) @item
|
||||
)
|
||||
|
||||
(
|
||||
(line_comment)* @context
|
||||
.
|
||||
(function_signature_item
|
||||
name: (_) @name) @item
|
||||
)
|
||||
(macro_definition
|
||||
name: (_) @name)
|
||||
] @item
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue