diff --git a/package.json b/package.json index 94b441f..7959f7b 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,16 @@ "default": 9000, "markdownDescription": "If adapter is `tcp`, use this port to connect to a running server.\n\nYou can start the server with `path/to/nextls --port `." }, + "elixir-tools.nextLS.MIX_ENV": { + "type": "string", + "default": "dev", + "markdownDescription": "The MIX_ENV to use when starting the runtime for your project." + }, + "elixir-tools.nextLS.MIX_TARGET": { + "type": "string", + "default": "host", + "markdownDescription": "The MIX_TARGET to use when starting the runtime for your project." + }, "elixir-tools.nextLS.installationDirectory": { "type": "string", "default": "~/.cache/elixir-tools/nextls/bin/", diff --git a/src/extension.ts b/src/extension.ts index c33eb05..5cb4a77 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -169,6 +169,12 @@ async function activateNextLS( throw new Error("boom"); } const clientOptions: LanguageClientOptions = { + initializationOptions: { + // eslint-disable-next-line @typescript-eslint/naming-convention + mix_env: config.get("MIX_ENV"), + // eslint-disable-next-line @typescript-eslint/naming-convention + mix_target: config.get("MIX_TARGET"), + }, documentSelector: [ { scheme: "file", language: "elixir" }, { scheme: "file", language: "surface" },