Skip to content

Commit 0b1cb06

Browse files
committed
fix: use Svelte 4 compiler from user when available
Svelte 4 has some fixes with regards to parsing the generics attribute. #2039
1 parent 00e347e commit 0b1cb06

File tree

1 file changed

+2
-1
lines changed
  • packages/language-server/src/plugins/typescript

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,11 @@ async function createLanguageService(
233233
svelteTsPath = __dirname;
234234
}
235235
const sveltePackageInfo = getPackageInfo('svelte', tsconfigPath || workspacePath);
236+
// Svelte 4 has some fixes with regards to parsing the generics attribute.
236237
// Svelte 5 has new features, but we don't want to add the new compiler into language-tools. In the future it's probably
237238
// best to shift more and more of this into user's node_modules for better handling of multiple Svelte versions.
238239
const svelteCompiler =
239-
sveltePackageInfo.version.major >= 5
240+
sveltePackageInfo.version.major >= 4
240241
? importSvelte(tsconfigPath || workspacePath)
241242
: undefined;
242243

0 commit comments

Comments
 (0)