From d7bda1f5d93c09033e92296ba1d7b29a6d46cf9b Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Wed, 12 May 2021 13:27:49 -0700 Subject: [PATCH] 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. --- packages/adl-vscode/src/extension.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/adl-vscode/src/extension.ts b/packages/adl-vscode/src/extension.ts index 546f93b39..646308f98 100644 --- a/packages/adl-vscode/src/extension.ts +++ b/packages/adl-vscode/src/extension.ts @@ -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() {