From 996923ab734b9c562b7ba1f55773905c88d0f809 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Fri, 5 Jul 2024 20:38:45 -0400 Subject: [PATCH] Add server-env option --- src/extension.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 7106db2..8b34507 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -60,8 +60,17 @@ export async function activate(context: ExtensionContext): Promise { if (existsSync(lsp)) { crystalOutputChannel.appendLine(`[Crystal] loading lsp ${lsp}`) + const server_env = config["server-env"] + + let serverOptions: ServerOptions = { + command: lsp, + args: [] + } + + if (server_env) { + serverOptions.options = { env: { ...process.env, ...server_env } } + } - let serverOptions: ServerOptions = { command: lsp, args: [] } let clientOptions: LanguageClientOptions = { documentSelector: selector, synchronize: {