Skip to content

Commit

Permalink
fix(language-server): LSP mode crash
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jun 26, 2024
1 parent ff17b8a commit 7a32486
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/language-server/lib/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function initialize(
ts,
tsLocalized,
async ({ configFileName, sys, projectHost, asFileName }) => {
let compilerOptions: ts.CompilerOptions;
let vueCompilerOptions: VueCompilerOptions;
if (configFileName) {
let commandLine = createParsedCommandLine(ts, sys, configFileName);
Expand All @@ -29,9 +30,11 @@ export function initialize(
sysVersion = newSysVersion;
newSysVersion = await sys.sync();
}
compilerOptions = commandLine.options;
vueCompilerOptions = commandLine.vueOptions;
}
else {
compilerOptions = ts.getDefaultCompilerOptions();
vueCompilerOptions = resolveVueCompilerOptions({});
}
updateFileWatcher(vueCompilerOptions);
Expand All @@ -47,7 +50,7 @@ export function initialize(
}
return fileMap.has(fileName);
},
projectHost.getCompilationSettings(),
compilerOptions,
vueCompilerOptions
)],
setup(language) {
Expand Down

0 comments on commit 7a32486

Please sign in to comment.