Skip to content

Commit 59b6bbf

Browse files
authored
(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
1 parent 9680a40 commit 59b6bbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/language-server/src/plugins/typescript/DocumentSnapshot.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ export namespace DocumentSnapshot {
134134
if (!normalizedPath.endsWith('node_modules/svelte/types/runtime/ambient.d.ts')) {
135135
originalText = ts.sys.readFile(filePath) || '';
136136
}
137-
if (normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts')) {
137+
if (
138+
normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts') ||
139+
normalizedPath.endsWith('svelte-check/dist/src/svelte-shims.d.ts')
140+
) {
138141
// If not present, the LS uses an older version of svelte2tsx
139142
if (originalText.includes('// -- start svelte-ls-remove --')) {
140143
originalText =

0 commit comments

Comments
 (0)