From 59b6bbfdbde47c71eeba81aa45a8abf7eddade3a Mon Sep 17 00:00:00 2001 From: "Lyu, Wei-Da" <36730922+jasonlyu123@users.noreply.github.com> Date: Tue, 3 May 2022 21:50:04 +0800 Subject: [PATCH] (fix) detect invalid Svelte import paths for svelte-check (#1471) #1448 #1468 Since the file is copied to the svelte-check build output. The path also needed to be considered --- .../src/plugins/typescript/DocumentSnapshot.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts b/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts index c4986b218..bd917bf4d 100644 --- a/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts +++ b/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts @@ -134,7 +134,10 @@ export namespace DocumentSnapshot { if (!normalizedPath.endsWith('node_modules/svelte/types/runtime/ambient.d.ts')) { originalText = ts.sys.readFile(filePath) || ''; } - if (normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts')) { + if ( + normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts') || + normalizedPath.endsWith('svelte-check/dist/src/svelte-shims.d.ts') + ) { // If not present, the LS uses an older version of svelte2tsx if (originalText.includes('// -- start svelte-ls-remove --')) { originalText =