Skip to content

Commit 40f068c

Browse files
prevent to create duplicate session (#2949)
Signed-off-by: msivasubramaniaan <[email protected]>
1 parent 2d68fc7 commit 40f068c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/openshift/component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ export class Component extends OpenShiftItem {
9393
return [
9494
debug.onDidStartDebugSession((session) => {
9595
if (session.configuration.contextPath) {
96-
Component.debugSessions.set(session.configuration.contextPath.fsPath, session);
96+
Component.debugSessions.set(session.configuration.contextPath, session);
9797
}
9898
}),
9999
debug.onDidTerminateDebugSession((session) => {
100100
if (session.configuration.contextPath) {
101-
Component.debugSessions.delete(session.configuration.contextPath.fsPath);
101+
Component.debugSessions.delete(session.configuration.contextPath);
102102
}
103103
})
104104
];
@@ -571,6 +571,7 @@ export class Component extends OpenShiftItem {
571571
@vsCommand('openshift.component.debug', true)
572572
static async debug(component: ComponentWorkspaceFolder): Promise<string | null> {
573573
if (!component) return null;
574+
if (Component.debugSessions.get(component.contextPath)) return Component.startDebugger(component);
574575
return Progress.execFunctionWithProgress(`Starting debugger session for the component '${component.component.devfileData.devfile.metadata.name}'.`, () => Component.startDebugger(component));
575576
}
576577

0 commit comments

Comments
 (0)