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

Auto import rune files (`.svelte.js`/`.svelte.ts`) files with full extension.

Open brunnerh opened this issue 1 year ago • 1 comments

Description

If a symbol from a .svelte.js file is selected from a suggestion dropdown in VS Code, the added import lacks the .js extension.

If the extension is missing, this can cause conflicts with components that share the prefix, it also is plain confusing to the uninitiated since it looks like a component is being imported.

Proposed solution

Always import as .svelte.js, not sure if this is possible though.

(Maybe use .svelte.ts if state of TS's allowImportingTsExtensions can be detected.)

Alternatives

No response

Additional Information, eg. Screenshots

No response

brunnerh avatar Dec 06 '24 14:12 brunnerh

I'm not sure we can reliably do this because some tooling might want to resolve .svelte.js to actual .js files when there's a .ts file.

I believe there's a VS Code setting which makes it so the full file path is used, so it might also be solveable through that.

dummdidumm avatar Jan 06 '25 16:01 dummdidumm