This reverts commit 1bbf98aea6.
We found that #38411 caused problems where anonymous functions are
included too many times in the outline. We'd like to figure out a better
fix before shipping this to stable.
Fixes #38956
Release Notes:
- (preview only) revert changes to outline view
120 lines
2.8 KiB
Scheme
120 lines
2.8 KiB
Scheme
(internal_module
|
|
"namespace" @context
|
|
name: (_) @name) @item
|
|
|
|
(enum_declaration
|
|
"enum" @context
|
|
name: (_) @name) @item
|
|
|
|
(function_declaration
|
|
"async"? @context
|
|
"function" @context
|
|
name: (_) @name
|
|
parameters: (formal_parameters
|
|
"(" @context
|
|
")" @context)) @item
|
|
|
|
(generator_function_declaration
|
|
"async"? @context
|
|
"function" @context
|
|
"*" @context
|
|
name: (_) @name
|
|
parameters: (formal_parameters
|
|
"(" @context
|
|
")" @context)) @item
|
|
|
|
(interface_declaration
|
|
"interface" @context
|
|
name: (_) @name) @item
|
|
|
|
(program
|
|
(export_statement
|
|
(lexical_declaration
|
|
["let" "const"] @context
|
|
; Multiple names may be exported - @item is on the declarator to keep
|
|
; ranges distinct.
|
|
(variable_declarator
|
|
name: (_) @name) @item)))
|
|
|
|
(program
|
|
(lexical_declaration
|
|
["let" "const"] @context
|
|
; Multiple names may be defined - @item is on the declarator to keep
|
|
; ranges distinct.
|
|
(variable_declarator
|
|
name: (_) @name) @item))
|
|
|
|
(class_declaration
|
|
"class" @context
|
|
name: (_) @name) @item
|
|
|
|
(method_definition
|
|
[
|
|
"get"
|
|
"set"
|
|
"async"
|
|
"*"
|
|
"readonly"
|
|
"static"
|
|
(override_modifier)
|
|
(accessibility_modifier)
|
|
]* @context
|
|
name: (_) @name
|
|
parameters: (formal_parameters
|
|
"(" @context
|
|
")" @context)) @item
|
|
|
|
(public_field_definition
|
|
[
|
|
"declare"
|
|
"readonly"
|
|
"abstract"
|
|
"static"
|
|
(accessibility_modifier)
|
|
]* @context
|
|
name: (_) @name) @item
|
|
|
|
; Add support for (node:test, bun:test and Jest) runnable
|
|
(
|
|
(call_expression
|
|
function: [
|
|
(identifier) @_name
|
|
(member_expression
|
|
object: [
|
|
(identifier) @_name
|
|
(member_expression object: (identifier) @_name)
|
|
]
|
|
)
|
|
] @context
|
|
(#any-of? @_name "it" "test" "describe" "context" "suite")
|
|
arguments: (
|
|
arguments . [
|
|
(string (string_fragment) @name)
|
|
(identifier) @name
|
|
]
|
|
)
|
|
)
|
|
) @item
|
|
|
|
; Add support for parameterized tests
|
|
(
|
|
(call_expression
|
|
function: (call_expression
|
|
function: (member_expression
|
|
object: [(identifier) @_name (member_expression object: (identifier) @_name)]
|
|
property: (property_identifier) @_property
|
|
)
|
|
(#any-of? @_name "it" "test" "describe" "context" "suite")
|
|
(#eq? @_property "each")
|
|
)
|
|
arguments: (
|
|
arguments . [
|
|
(string (string_fragment) @name)
|
|
(identifier) @name
|
|
]
|
|
)
|
|
)
|
|
) @item
|
|
|
|
(comment) @annotation
|