Skip to content

Commit 996923a

Browse files
Add server-env option
1 parent 4df634b commit 996923a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/extension.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,17 @@ export async function activate(context: ExtensionContext): Promise<void> {
6060

6161
if (existsSync(lsp)) {
6262
crystalOutputChannel.appendLine(`[Crystal] loading lsp ${lsp}`)
63+
const server_env = config["server-env"]
64+
65+
let serverOptions: ServerOptions = {
66+
command: lsp,
67+
args: []
68+
}
69+
70+
if (server_env) {
71+
serverOptions.options = { env: { ...process.env, ...server_env } }
72+
}
6373

64-
let serverOptions: ServerOptions = { command: lsp, args: [] }
6574
let clientOptions: LanguageClientOptions = {
6675
documentSelector: selector,
6776
synchronize: {

0 commit comments

Comments
 (0)