mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
fix(debug): load run configuration .env files for debug launches (#2633)
Debug launches only copied the explicit env map into the DAP launch arguments and dropped the configuration's .env files, which Run loads via ide_run::envfile. Add a run_env_files command that loads the files with the same loader over the system environment, and merge the result under the explicit variables when building debug launches (generic, plugin-hosted and java-debug paths); explicit variables still win and a missing file fails the launch with the same error Run reports. Fixes #753 (comment): .env applied in Run but ignored in Debug.
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
type JavaPreparation,
|
||||
} from "@/platform/javaLaunch";
|
||||
import { maybeEditorService, notifications } from "@/workbench/contributions";
|
||||
import { withEnvFiles } from "./launch";
|
||||
|
||||
export const JAVA_ADAPTER = "java-debug";
|
||||
export const KOTLIN_ADAPTER = "kotlin-debug-adapter";
|
||||
@@ -111,6 +112,7 @@ export async function javaLaunchConfig(
|
||||
preparation?: JavaPreparation,
|
||||
): Promise<LaunchConfig> {
|
||||
const cwd = rc.cwd ? join(root, rc.cwd) : root;
|
||||
rc = await withEnvFiles(rc, root);
|
||||
const parsed = parseJavaArgs(rc.args);
|
||||
if (!parsed.mainClass) throw new Error(`No main class in '${rc.name}'`);
|
||||
preparation?.signal.throwIfAborted();
|
||||
|
||||
Reference in New Issue
Block a user