Fix arrow function detection in TypeScript/JavaScript outline (#38411)

Closes #35102 



https://github.com/user-attachments/assets/3c946d6c-0acd-4cfe-8cb3-61eb6d20f808


Release Notes:

- TypeScript/JavaScript: symbol outline now includes closures nested
within functions.
This commit is contained in:
strygwyr authored and GitHub committed 2025-09-22 14:35:43 +02:00
1 parent 7cd1583913
commit 19e4cb620e
3 files changed
+66

No files matched your search

@@ -116,4 +116,26 @@
)
) @item
; Arrow functions in variable declarations (anywhere in the tree, including nested in functions)
(lexical_declaration
["let" "const"] @context
(variable_declarator
name: (_) @name
value: (arrow_function)) @item)
; Async arrow functions in variable declarations
(lexical_declaration
["let" "const"] @context
(variable_declarator
name: (_) @name
value: (arrow_function
"async" @context)) @item)
; Named function expressions in variable declarations
(lexical_declaration
["let" "const"] @context
(variable_declarator
name: (_) @name
value: (function_expression)) @item)
(comment) @annotation