Skip to content

Commit 2d77c7c

Browse files
committed
Fix type error
1 parent 9c16241 commit 2d77c7c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/extension.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ export async function activateLanguageServer(context: vscode.ExtensionContext, s
8080
} else {
8181
separator = ':';
8282
}
83-
let pathList: string[] = conf.get('server.toolsPath')!;
84-
toolsPath = pathList.join(separator);
85-
if (toolsPath.length > 0) {
86-
toolsPath = toolsPath + separator + process.env['PATH']!;
87-
} else {
88-
toolsPath = process.env['PATH']!;
83+
let pathList: string[]|undefined = conf.get('server.toolsPath');
84+
if (pathList) {
85+
toolsPath = pathList.join(separator);
86+
if (toolsPath.length > 0) {
87+
toolsPath = toolsPath + separator + process.env['PATH']!;
88+
} else {
89+
toolsPath = process.env['PATH']!;
90+
}
8991
}
9092
outputChannel.appendLine('toolsPath: ' + toolsPath);
9193
let serverOptions: ServerOptions = {

0 commit comments

Comments
 (0)