
Followup: https://github.com/zed-industries/zed/pull/21246 **Before** <img width="545" alt="Screenshot 2024-11-30 at 13 27 15" src="https://github.com/user-attachments/assets/3346e485-96c8-482d-b5fd-85b86f37d662"> **After** <img width="537" alt="Screenshot 2024-11-30 at 13 27 36" src="https://github.com/user-attachments/assets/3cedcaa5-e285-47fb-909d-16d37d9844ca"> We did not need to add the `*` as it was already matching one of them, we actually need at least one of them, so making it optional was a mistake. Don't think we need to add release notes, as the change is only on main the branch now. Release Notes: - N/A
91 lines
1.9 KiB
Scheme
91 lines
1.9 KiB
Scheme
(internal_module
|
|
"namespace" @context
|
|
name: (_) @name) @item
|
|
|
|
(enum_declaration
|
|
"enum" @context
|
|
name: (_) @name) @item
|
|
|
|
(type_alias_declaration
|
|
"type" @context
|
|
name: (_) @name) @item
|
|
|
|
(function_declaration
|
|
"async"? @context
|
|
"function" @context
|
|
name: (_) @name
|
|
parameters: (formal_parameters
|
|
"(" @context
|
|
")" @context)) @item
|
|
|
|
(interface_declaration
|
|
"interface" @context
|
|
name: (_) @name) @item
|
|
|
|
(export_statement
|
|
(lexical_declaration
|
|
["let" "const"] @context
|
|
(variable_declarator
|
|
name: (_) @name) @item))
|
|
|
|
(program
|
|
(lexical_declaration
|
|
["let" "const"] @context
|
|
(variable_declarator
|
|
name: (_) @name) @item))
|
|
|
|
(class_declaration
|
|
"class" @context
|
|
name: (_) @name) @item
|
|
|
|
(abstract_class_declaration
|
|
"abstract" @context
|
|
"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")
|
|
arguments: (
|
|
arguments . (string (string_fragment) @name)
|
|
)
|
|
)
|
|
) @item
|
|
|
|
(comment) @annotation
|