language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Find references command create a .vscode/settings.json file in svelte projects

Open gtm-nayan opened this issue 1 year ago • 3 comments

Describe the bug

Using either of Svelte: Find Component References or Typescript: Find file references commands in a Svelte project creates an empty .vscode/settings.json file.

I haven't been able to replicate in other repos without Svelte files so I think this is specific to the Svelte extension somehow.

Reproduction

pnpm create svelte pnpm i Open in vscode Run the Svelte: Find Component References command Observe a new file .vscode/settings.json appears with the contents

{
}

Expected behaviour

.vscode/settings.json to not be created

System Info

  • OS: Windows
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

gtm-nayan avatar Apr 15 '24 10:04 gtm-nayan

Duplicate of #1516. But It should be Svelte: Find file reference that will create an empty setting. The reason is the lack of API to make the reference UI always use the references view (sidebar) instead of peek.

Typescript: Find file references is the ts equivalent of Svelte: Find file reference. TypeScript extension provided this feature and should also have the same problem for non-svelte projects. We adopted the implementation from VSCode so both have the same problem. If your Svelte: Find file reference does have the problem, it might have something to do with your user setting or is caused by another extension.

jasonlyu123 avatar Apr 15 '24 10:04 jasonlyu123

@gtm-nayan could you double check if Svelte: Find Component References really creates a file, and if yes, check if this happens if only the Svelte extension is enabled?

dummdidumm avatar Apr 25 '24 06:04 dummdidumm

Both the Svelte: and the Typescript: commands create the files for me, the Svelte: command is not available with the extension disabled, but the other one seems to create the file even after I disable the extension and restart VSCode.

I think I missed the file being created in the non-Svelte repo because it was not tracked by git. Oops.

gtm-nayan avatar Apr 25 '24 07:04 gtm-nayan