Files
serena/test
Michael PanchenkoandClaude Opus 4.8 79bc9d91cc Fix Svelte (svelte-only) symbol discovery in .ts/.js files (#1552)
Bug: with `languages: [svelte]` (the documented setup), find_symbol/get_symbols_overview returned
empty for .ts/.js files, and find_referencing_symbols failed with "No symbol matching '<name>'
found". Symbols living in plain .ts/.js modules (services, stores, types, utils) were undiscoverable
through Serena's symbolic tools.

Cause: SvelteLanguageServer delegated references/definition/rename/diagnostics for .ts/.js files to
the companion (svelte-plugin-aware) TS server, but had no override for document-symbol requests. So
documentSymbol on a .ts/.js file was answered by the base svelte LS, which only serves .svelte
files, and returned nothing. Since find_symbol/get_symbols_overview are backed by documentSymbol --
and find_referencing_symbols must first locate the target symbol the same way -- the discovery step
never reached the companion.

Fix: override request_document_symbols to route .ts/.js files to the companion TS server, mirroring
the existing delegations. This is the single method that all symbol-tree/overview/containing-symbol
paths flow through, so it restores discovery for find_symbol, get_symbols_overview,
find_referencing_symbols and symbol-based editing in one place.

Tests: add .ts document-symbol and overview coverage plus agent-level symbol-retriever tests;
strengthen the existing symbol-tree test to assert GAME_VERSION, a symbol defined only in a .ts file
(the prior assertions also matched .svelte definitions, which is why the regression went unnoticed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:15:53 +03:00
..