Intellisense for component import does not work if the component is not in the same directory, a child directory, or a parent directory.
<script>
import My
</script>
./src/components/My1stComponent.svelte
./src/components/My2ndComponent.svelte
./src/components/subcomponents/My3rdComponent.svelte
./src/components/othercomponents/My4thComponent.svelte
BTW Running the following is optional as the issue still repros with or without typescript.
node scripts/setupTypeScript.js
I tried reproducing the issue with only three components. I eliminated the My2ndComponent and renamed My3rdComponent to My2ndComponent and My4thComponent to My3rdComponent. When attempting to import My3rdComponent into My2ndComponent the issue didn't repro. i.e.
./src/components/My1stComponent.svelte
./src/components/subcomponents/My2ndComponent.svelte
./src/components/othercomponents/My3rdComponent.svelte
The following output is generated by Svelte when typeing "import My" into the My3rd Component.
Using Svelte v3.48.0 from /Users/foobar/Developer/svelte-app-2/node_modules/svelte/compiler
[96msrc/components/subcomponents/My3rdComponent.svelte.injected.ts[0m:[93m17[0m:[93m1[0m - [91merror[0m[90m TS1005: [0m'=' expected.
[7m17[0m const $$$$$$$$ = null;
[7m [0m [91m~~~~~[0m
Preprocessing failed
Error: [svelte-preprocess] Encountered type error
at throwError (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/modules/errors.js:5:11)
at throwTypescriptError (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/modules/errors.js:9:28)
at transpileTs (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/transformers/typescript.js:177:47)
at mixedImportsTranspiler (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/transformers/typescript.js:232:60)
at transformer (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/transformers/typescript.js:302:11)
at transform (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/autoProcess.js:37:12)
at async /Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/autoProcess.js:118:29
at async Object.script (/Users/foobar/Developer/svelte-app-2/node_modules/svelte-preprocess/dist/autoProcess.js:148:33)
at async wrappedPreprocessor.script (/Users/foobar/.vscode/extensions/svelte.svelte-vscode-105.18.1/node_modules/svelte-language-server/dist/src/plugins/svelte/SvelteDocument.js:249:28)
at async process_single_tag (/Users/foobar/Developer/svelte-app-2/node_modules/svelte/compiler.js:32503:28) {
__source: 'Script'
}