zed/crates/grammars
Emamul Andalib f2cead49b1
languages: Fix nested object methods missing from outline panel (#50754)
Shorthand methods (`methodName() {}`) inside nested object literals were
not shown in the Outline panel. The outline query only captured
method_definition when it was a direct child of a variable_declarator's
object, so nested objects (e.g. `deep: { subFn() {} }`) were missed.

Extended the outline query to match method_definition in any object
node, not just top-level variable_declarator objects. Applied the fix to
TypeScript, JavaScript, and TSX outline definitions. Added tests for the
issue reproduction and edge cases.

Supporting evidence:
<img width="1352" height="812" alt="image"
src="https://github.com/user-attachments/assets/64868a70-abd3-4935-9c03-4c809b55262b"
/>

Fixes #48711

Release Notes:

- Fixed nested object methods not appearing in the Outline panel for
JavaScript and TypeScript files
2026-04-21 00:36:39 +02:00
..
src languages: Fix nested object methods missing from outline panel (#50754) 2026-04-21 00:36:39 +02:00
Cargo.toml Extract language_core and grammars crates from language (#52238) 2026-03-25 23:41:09 +00:00
LICENSE-GPL Extract language_core and grammars crates from language (#52238) 2026-03-25 23:41:09 +00:00