File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
test/plugins/typescript/features Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,16 @@ async function createLanguageService(
228228 forcedCompilerOptions ,
229229 tsconfigPath ,
230230 undefined ,
231- [ { extension : 'svelte' , isMixedContent : false , scriptKind : ts . ScriptKind . TSX } ]
231+ [
232+ {
233+ extension : 'svelte' ,
234+ isMixedContent : true ,
235+ // Deferred was added in a later TS version, fall back to tsx
236+ // If Deferred exists, this means that all Svelte files are included
237+ // in parsedConfig.fileNames
238+ scriptKind : ts . ScriptKind . Deferred ?? ts . ScriptKind . TSX
239+ }
240+ ]
232241 ) ;
233242
234243 const compilerOptions : ts . CompilerOptions = {
Original file line number Diff line number Diff line change @@ -606,12 +606,12 @@ describe.only('CompletionProviderImpl', () => {
606606 item !
607607 ) ;
608608
609- assert . strictEqual ( detail , 'Auto import from ./imported-file.svelte\nclass ImportedFile' ) ;
609+ assert . strictEqual ( detail , 'Auto import from .. /imported-file.svelte\nclass ImportedFile' ) ;
610610
611611 assert . strictEqual (
612612 harmonizeNewLines ( additionalTextEdits ! [ 0 ] ?. newText ) ,
613613 // " instead of ' because VSCode uses " by default when there are no other imports indicating otherwise
614- `${ newLine } import ImportedFile from "./imported-file.svelte";${ newLine } `
614+ `${ newLine } import ImportedFile from ".. /imported-file.svelte";${ newLine } `
615615 ) ;
616616
617617 assert . deepEqual (
@@ -641,12 +641,12 @@ describe.only('CompletionProviderImpl', () => {
641641 item !
642642 ) ;
643643
644- assert . strictEqual ( detail , 'Auto import from ./imported-file.svelte\nclass ImportedFile' ) ;
644+ assert . strictEqual ( detail , 'Auto import from .. /imported-file.svelte\nclass ImportedFile' ) ;
645645
646646 assert . strictEqual (
647647 harmonizeNewLines ( additionalTextEdits ! [ 0 ] ?. newText ) ,
648648 // " instead of ' because VSCode uses " by default when there are no other imports indicating otherwise
649- `<script>${ newLine } import ImportedFile from "./imported-file.svelte";` +
649+ `<script>${ newLine } import ImportedFile from ".. /imported-file.svelte";` +
650650 `${ newLine } ${ newLine } </script>${ newLine } `
651651 ) ;
652652
You can’t perform that action at this time.
0 commit comments