Repository: eclipse-corrosion/corrosion (language: rust)

Issue:
Run config does not take environment variable config into account
When starting a cargo run command via launch config, the "Environment" tab is shown in the launch config, but the configured variables are not taken into account during the actual launch. This is e.g. needed when the variable "RUST_BACKTRACE" has to be defined to get more detailed error messages from a program stopping from a panic.


Discussion / hints:

Fix patch:
diff --git a/org.eclipse.corrosion/src/org/eclipse/corrosion/run/CargoRunDelegate.java b/org.eclipse.corrosion/src/org/eclipse/corrosion/run/CargoRunDelegate.java
index 1f03daf..8d03399 100644
--- a/org.eclipse.corrosion/src/org/eclipse/corrosion/run/CargoRunDelegate.java
+++ b/org.eclipse.corrosion/src/org/eclipse/corrosion/run/CargoRunDelegate.java
@@ -115,10 +115,11 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
 
 		final List<String> finalRunCommand = cargoRunCommand;
 		final File finalWorkingDirectory = workingDirectory;
+		final String[] envArgs = DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration);
 		CompletableFuture.runAsync(() -> {
 			try {
 				String[] cmdLine = finalRunCommand.toArray(new String[finalRunCommand.size()]);
-				Process p = DebugPlugin.exec(cmdLine, finalWorkingDirectory);
+				Process p = DebugPlugin.exec(cmdLine, finalWorkingDirectory, envArgs);
 				IProcess process = DebugPlugin.newProcess(launch, p, "cargo run"); //$NON-NLS-1$
 				process.setAttribute(IProcess.ATTR_CMDLINE, String.join(" ", cmdLine)); //$NON-NLS-1$
 			} catch (CoreException e) {


Test patch: