Fix issue launching adl-server on Mac OS (#547)

We were clearing environment variables down to one environment variable
rather than adding one for node options.
This commit is contained in:
Nick Guerrera 2021-05-12 13:27:49 -07:00 коммит произвёл GitHub
Родитель 69a6b60cab
Коммит d7bda1f5d9
1 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -1,5 +1,10 @@
import { ExtensionContext, workspace } from "vscode";
import { Executable, LanguageClient, LanguageClientOptions } from "vscode-languageclient/node.js";
import {
Executable,
ExecutableOptions,
LanguageClient,
LanguageClientOptions,
} from "vscode-languageclient/node.js";
let client: LanguageClient | undefined;
@ -50,7 +55,14 @@ function resolveADLServer(context: ExtensionContext): Executable {
command += ".cmd";
}
return { command, args, options: { env: { NODE_OPTIONS: nodeOptions } } };
let options: ExecutableOptions | undefined;
if (nodeOptions) {
options = {
env: { ...process.env, NODE_OPTIONS: nodeOptions },
};
}
return { command, args, options };
}
export async function deactivate() {