fix(services): show the service port for debug sessions like for run (#1789)

A direct debug launch had no Run session to carry the app's HTTP port, so
its Services node only showed Debugging/Starting. The debugger now parses
the same embedded web server startup line as Run, publishes the port on
DebugServiceSession, and the node shows :port as soon as the app announces
it, exactly like a running service (#1718).

Signed-off-by: Inf1mum <[email protected]>
Цей коміт міститься в:
Vadim Lazuk authored and GitHub committed 2026-11-07 02:32:06 +08:00
1 джерело d0c3b9ba34
коміт b2253a8bc8
6 files changed
+84 -6

No files matched your search

+24
Переглянути файл
@@ -109,6 +109,30 @@ describe("run configurations in Services", () => {
expect(attached[0]?.children?.[0]?.detail).toBe(":8080");
});
it("shows the app port of a direct debug session like for Run", () => {
const c = config("app", "spring-boot");
const d: DebugServiceSession = {
id: 1,
config: c,
status: "running",
processId: null,
startedAt: 2,
httpPort: 8080,
stop: async () => {},
rerun: null,
show: () => {},
};
expect(runServiceItems([c], [], DEFAULT_TYPES, [], {}, [d])[0]?.children?.[0]).toMatchObject({
detail: ":8080",
icon: "debug",
dim: false,
});
// A paused debugger still wins over the announced port.
expect(
runServiceItems([c], [], DEFAULT_TYPES, [], {}, [{ ...d, status: "paused" }])[0]?.children?.[0]?.detail,
).toBe("Suspended");
});
it("applies display order to detected and saved configurations of every language", () => {
const configs = [
config("java-a", "spring-boot"),
+8 -6
Переглянути файл
@@ -227,12 +227,14 @@ function executionDetail(s: ServiceSession | undefined): string | undefined {
if (!s) return undefined;
const debug = serviceDebugger(s);
if (debug?.status === "paused") return "Suspended";
if (debug)
return s.run && busy(s.run) && s.run.httpPort
? `:${s.run.httpPort}`
: debug.status === "starting"
? "Starting"
: "Debugging";
if (debug) {
// The app's HTTP port: a Run owns the console for an attached debugger, a direct
// debug launch announces it on the debug session's own console (#1718).
const run = s.run && busy(s.run) ? s.run : undefined;
const port = run?.httpPort ?? debug.httpPort;
if (port) return `:${port}`;
return debug.status === "starting" ? "Starting" : "Debugging";
}
return s.run ? sessionDetail(s.run) : "Finished";
}