mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix runner in execution environment after configuration editing on execution attempt.
Some configuration types can support more than single debug runner type and after editing properties of such configuration selected runner should be recalculated and environment needs to be updated. GitOrigin-RevId: d9235093f8e71305efeb43832f53bfaab959009b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
80783d418e
commit
ec6937be0b
@@ -32,7 +32,7 @@ public class ProgramRunnerUtil {
|
||||
private ProgramRunnerUtil() { }
|
||||
|
||||
@Nullable
|
||||
public static ProgramRunner getRunner(@NotNull String executorId, @Nullable RunnerAndConfigurationSettings configuration) {
|
||||
public static ProgramRunner<?> getRunner(@NotNull String executorId, @Nullable RunnerAndConfigurationSettings configuration) {
|
||||
return configuration == null ? null : ProgramRunner.getRunner(executorId, configuration.getConfiguration());
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ public class ProgramRunnerUtil {
|
||||
|
||||
RunnerAndConfigurationSettings runnerAndConfigurationSettings = environment.getRunnerAndConfigurationSettings();
|
||||
final Project project = environment.getProject();
|
||||
ProgramRunner<?> runner = environment.getRunner();
|
||||
|
||||
if (runnerAndConfigurationSettings != null) {
|
||||
if (!ExecutionTargetManager.canRun(environment)) {
|
||||
ExecutionUtil.handleExecutionError(environment, new ExecutionException(
|
||||
@@ -79,9 +81,18 @@ public class ProgramRunnerUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// corresponding runner can be changed after configuration edit
|
||||
runner = getRunner(environment.getExecutor().getId(), runnerAndConfigurationSettings);
|
||||
}
|
||||
|
||||
try {
|
||||
if (runner == null) {
|
||||
throw new ExecutionException("Cannot find runner for " + environment.getRunProfile().getName());
|
||||
}
|
||||
if (!runner.equals(environment.getRunner())) {
|
||||
environment = new ExecutionEnvironmentBuilder(environment).runner(runner).build();
|
||||
}
|
||||
if (assignNewId) {
|
||||
environment.assignNewExecutionId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user