sveltejs/language-tools

Can't find symbols unless *.ts/*.js file is open

Opened this issue · 2 comments

Describe the bug

There is a known bug / inconvenience in VSCode: if you don't open any *ts/*js files in your project, you can not find symbols defined there using "Go to symbol in workspace..." command.

But when working on Svelte project, having any *.svelte file open is not enough to make the command to work: you always have "no matching symbols" message. You still need to open *.ts file to make it work.

Reproduction

  1. Open VSCode with Svelte plugin enabled
  2. Open any workspace containing svelte files
  3. Open any *.svelte file in editor
  4. Execute "Go to symbol in workspace..." command from the command palette and try to find any existing symbol from your workspace
  5. See that there is no results

Expected behaviour

Open *.svelte file should be treated by VScode as a ts/js file, and should activate JS/TS extension to perform symbol search.

System Info

  • OS: macos 14.4.1 (23E224)
  • IDE: vscode Version: 1.89.0 (Universal)

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

image

Marking this as a feature request because we didn't actually have workspace symbol support. What you see is provided by the TypeScript extension. Most of the current TypeScript features for svelte files are also provided by the Svelte extension while The TypeScript extension provides the ts/js features. It is separated, opening a svelte file won't automatically activate the TypeScript extension.

Could be convenient to have at least TypeScript extension activated if the Svelte file with script lang=ts is open.