Skip to content

Commit 0f0d9cf

Browse files
authored
(fix) adjust error message (#1184)
suggest lang="ts" instead of lang="typescript" as the former is more common, shorter, and right now Vite does not support the latter
1 parent 8f086bb commit 0f0d9cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/language-server/src/plugins/svelte/features/getDiagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async function createParserErrorDiagnostic(error: any, document: Document) {
9696
'\n\nIf you expect this syntax to work, here are some suggestions: ';
9797
if (isInScript) {
9898
diagnostic.message +=
99-
'\nIf you use typescript with `svelte-preprocess`, did you add `lang="typescript"` to your `script` tag? ';
99+
'\nIf you use typescript with `svelte-preprocess`, did you add `lang="ts"` to your `script` tag? ';
100100
} else {
101101
diagnostic.message +=
102102
'\nIf you use less/SCSS with `svelte-preprocess`, did you add `lang="scss"`/`lang="less"` to you `style` tag? ' +

packages/language-server/test/plugins/svelte/features/getDiagnostics.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ describe('SveltePlugin#getDiagnostics', () => {
219219
message:
220220
'expected x to not be here' +
221221
'\n\nIf you expect this syntax to work, here are some suggestions: ' +
222-
'\nIf you use typescript with `svelte-preprocess`, did you add `lang="typescript"` to your `script` tag? ' +
222+
'\nIf you use typescript with `svelte-preprocess`, did you add `lang="ts"` to your `script` tag? ' +
223223
'\nDid you setup a `svelte.config.js`? ' +
224224
'\nSee https://github.com/sveltejs/language-tools/tree/master/docs#using-with-preprocessors for more info.',
225225
range: {

0 commit comments

Comments
 (0)