diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb5e116..659a255 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 20 - name: Install Node.js modules run: npm install @@ -65,7 +65,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 20 - name: Install Node.js modules run: npm install @@ -101,7 +101,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 20 - name: Install Node.js modules run: npm install diff --git a/Configuration.md b/Configuration.md index b4498c0..12e07c2 100644 --- a/Configuration.md +++ b/Configuration.md @@ -115,7 +115,7 @@ In case you want to manually edit the configuration, below are the explanation a } ``` -- `envFile` - Absolute path to a file containing environment variable definitions. +- `envFile` - Absolute path to a file containing environment variable definitions. Multiple files can be specified by providing an array of absolute paths ```json { "version": "0.2.0", diff --git a/README.md b/README.md index 649e918..54e122f 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht - `projectName` - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program. It is required when the workspace has multiple java projects, otherwise the expression evaluation and conditional breakpoint may not work. - `cwd` - The working directory of the program. Defaults to `${workspaceFolder}`. - `env` - The extra environment variables for the program. -- `envFile` - Absolute path to a file containing environment variable definitions. +- `envFile` - Absolute path to a file containing environment variable definitions. Multiple files can be specified by providing an array of absolute paths - `stopOnEntry` - Automatically pause the program after launching. - `console` - The specified console to launch the program. If not specified, use the console specified by the `java.debug.settings.console` user setting. - `internalConsole` - VS Code debug console (input stream not supported). diff --git a/package.json b/package.json index fad8bd2..5f11af4 100644 --- a/package.json +++ b/package.json @@ -486,7 +486,10 @@ "default": {} }, "envFile": { - "type": "string", + "type": [ + "array", + "string" + ], "description": "%java.debugger.launch.envFile.description%", "default": "${workspaceFolder}/.env" }, diff --git a/package.nls.json b/package.nls.json index 0ca0ce3..3bd7299 100644 --- a/package.nls.json +++ b/package.nls.json @@ -18,7 +18,7 @@ "java.debugger.launch.encoding.description": "The file.encoding setting for the JVM. Possible values can be found in https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.", "java.debugger.launch.cwd.description": "The working directory of the program. Defaults to the current workspace root.", "java.debugger.launch.env.description": "The extra environment variables for the program.", - "java.debugger.launch.envFile.description": "Absolute path to a file containing environment variable definitions.", + "java.debugger.launch.envFile.description": "Absolute path to a file containing environment variable definitions. Multiple files can be specified by providing an array of absolute paths.", "java.debugger.launch.stopOnEntry.description": "Automatically pause the program after launching.", "java.debugger.launch.internalConsole.description": "VS Code debug console (input stream not supported).", "java.debugger.launch.integratedTerminal.description": "VS Code integrated terminal.", diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index c43dfca..5b4ce38 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -187,10 +187,20 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration let result = baseEnv; if (config.envFile) { try { - result = { - ...baseEnv, - ...readEnvFile(config.envFile), - }; + if (typeof config.envFile === 'string') { + result = { + ...result, + ...readEnvFile(config.envFile) + }; + } + if (Array.isArray(config.envFile)) { + config.envFile.forEach((f) => { + result = { + ...result, + ...readEnvFile(f) + }; + }); + } } catch (e) { throw new utility.UserError({ message: "Cannot load environment file.",