Skip to content

Commit 76fcd82

Browse files
committed
chore(language-service): add restart server hint to global types warning
close #5554
1 parent 7b55e64 commit 76fcd82

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

packages/language-service/lib/plugins/vue-global-types-error.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,19 @@ export function create(): LanguageServicePlugin {
4141
start: document.positionAt(0),
4242
end: document.positionAt(0),
4343
},
44-
severity: 1 satisfies typeof DiagnosticSeverity.Error,
44+
severity: 2 satisfies typeof DiagnosticSeverity.Warning,
4545
code: 404,
4646
source: 'vue',
47-
message:
48-
`Write global types file failed. Please ensure that "node_modules" exists and "${vueCompilerOptions.lib}" is a direct dependency, or set "vueCompilerOptions.globalTypesPath" in "tsconfig.json" manually.`,
47+
message: `
48+
Failed to write the global types file. Make sure that:
49+
50+
1. "node_modules" directory exists.
51+
2. "${vueCompilerOptions.lib}" is installed as a direct dependency.
52+
53+
Alternatively, you can manually set "vueCompilerOptions.globalTypesPath" in your "tsconfig.json".
54+
55+
If all dependencies are installed, try running the "vue.action.restartServer" command to restart Vue and TS servers.
56+
`.trim(),
4957
}];
5058
},
5159
};

0 commit comments

Comments
 (0)