fix(build-tools): running a goal or task from the tool window leaves the selected configuration alone (#8028)

Running a Maven goal or Gradle task from its tool window went through run.runConfig with a temporary configuration, and adoptTemporary always selected it, so the just-run goal replaced the configuration selected in the Run Configurations dropdown. The tool window now passes select: false and adoptTemporary only selects when asked; editor and gutter runs still select their temporary configuration.

Fixes #8016

Co-authored-by: Inf1mum <[email protected]>
Цей коміт міститься в:
Vadim LazukтаInf1mum authored and GitHub committed 2026-12-04 20:17:47 +08:00
1 джерело 1f8cf7e3a8
коміт 2cad48b401
5 files changed
+41 -11

No files matched your search

+11
Переглянути файл
@@ -736,6 +736,17 @@ describe("temporary configurations", () => {
expect(useRun.getState().temporary).toEqual([]);
});
it("leave the selected configuration alone when the run asks not to select (Maven / Gradle tool windows)", () => {
useRun.setState({ selectedId: "maven:spring-boot:run" });
const goal = cfg({ id: "maven:clean", kind: "maven", command: "./mvnw", args: ["clean"], cwd: "/p" });
adoptTemporary(goal, false);
expect(useRun.getState().selectedId).toBe("maven:spring-boot:run");
expect(useRun.getState().temporary).toEqual([goal.id]);
// The default still selects: editor-context runs rely on it.
const app = adoptTemporary(applicationConfig({ className: "a.Main" }, "src/main/java/a/Main.java"));
expect(useRun.getState().selectedId).toBe(app.id);
});
it("reuse a configuration of the same main class and module, whatever its id", () => {
const own = (module: string) =>
cfg({