Something went wrong. Try again.
a few hacks on top of zed
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586(comment)+ @comment.around
(function_declaration body: (_ "{" (_)* @function.inside "}")) @function.around
(method_definition body: (_ "{" (_)* @function.inside "}")) @function.around
(function_expression body: (_ "{" (_)* @function.inside "}")) @function.around
((arrow_function body: (statement_block "{" (_)* @function.inside "}")) @function.around (#not-has-parent? @function.around variable_declarator))
; Arrow function in variable declaration - capture the full declaration([ (lexical_declaration (variable_declarator value: (arrow_function body: (statement_block "{" (_)* @function.inside "}")))) (variable_declaration (variable_declarator value: (arrow_function body: (statement_block "{" (_)* @function.inside "}"))))]) @function.around
; Arrow function in variable declaration (captures body for expression-bodied arrows)([ (lexical_declaration (variable_declarator value: (arrow_function body: (_) @function.inside))) (variable_declaration (variable_declarator value: (arrow_function body: (_) @function.inside)))]) @function.around
; Catch-all for arrow functions in other contexts (callbacks, etc.)((arrow_function body: (_) @function.inside) @function.around (#not-has-parent? @function.around variable_declarator))
(generator_function body: (_ "{" (_)* @function.inside "}")) @function.around
(generator_function_declaration body: (_ "{" (_)* @function.inside "}")) @function.around
(class_declaration body: (_ "{" [(_) ";"?]* @class.inside "}" )) @class.around
(class body: (_ "{" [(_) ";"?]* @class.inside "}" )) @class.around