vim: Make vaf include const for arrow functions in JS/TS/TSX (#45327)

Closes #24264

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Ben Kunkle authored and GitHub committed 2025-12-18 21:56:47 -05:00
1 parent e0ff995e2d
commit 435d4c5f24
8 files changed
+742 -20

No files matched your search

@@ -18,13 +18,47 @@
(_)* @function.inside
"}")) @function.around
(arrow_function
((arrow_function
body: (statement_block
"{"
(_)* @function.inside
"}")) @function.around
(#not-has-parent? @function.around variable_declarator))
(arrow_function) @function.around
; 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: (_