Skip to content

Commit a09f64a

Browse files
authored
Add support for multilaunch for Blazorwasm (#6432)
This PR adds in the support for handling two launch configurations from the ILaunchConfigurationService and will launch the client as a seperate debug session.
1 parent ba4cb64 commit a09f64a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/shared/dotnetConfigurationProvider.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,19 @@ export class DotnetConfigurationResolver implements vscode.DebugConfigurationPro
139139
}
140140
if (debugConfigArray.length == 1) {
141141
return debugConfigArray[0];
142-
} else if (debugConfigArray.length > 1) {
143-
throw new InternalServiceError('Multiple launch targets is not yet supported.');
142+
} else if (debugConfigArray.length === 2) {
143+
// This creates a onDidStartDebugSession event listener that will dispose of itself when it detects
144+
// the debugConfiguration that is return from this method has started.
145+
const startDebugEvent = vscode.debug.onDidStartDebugSession((debugSession: vscode.DebugSession) => {
146+
if (debugSession.name === debugConfigArray[0].name) {
147+
startDebugEvent.dispose();
148+
vscode.debug.startDebugging(debugSession.workspaceFolder, debugConfigArray[1], debugSession);
149+
}
150+
});
151+
152+
return debugConfigArray[0];
153+
} else if (debugConfigArray.length > 2) {
154+
throw new InternalServiceError('Multiple launch targets (>2) is not yet supported.');
144155
} else {
145156
throw new InternalServiceError(
146157
'Unexpected configuration array from IDotnetDebugConfigurationServiceResult.'

0 commit comments

Comments
 (0)