Skip to content

Commit

Permalink
Add support for multilaunch for Blazorwasm (#6432)
Browse files Browse the repository at this point in the history
This PR adds in the support for handling two launch configurations from
the ILaunchConfigurationService and will launch the client as a seperate
debug session.
  • Loading branch information
WardenGnaw authored Sep 26, 2023
1 parent ba4cb64 commit a09f64a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/shared/dotnetConfigurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,19 @@ export class DotnetConfigurationResolver implements vscode.DebugConfigurationPro
}
if (debugConfigArray.length == 1) {
return debugConfigArray[0];
} else if (debugConfigArray.length > 1) {
throw new InternalServiceError('Multiple launch targets is not yet supported.');
} else if (debugConfigArray.length === 2) {
// This creates a onDidStartDebugSession event listener that will dispose of itself when it detects
// the debugConfiguration that is return from this method has started.
const startDebugEvent = vscode.debug.onDidStartDebugSession((debugSession: vscode.DebugSession) => {
if (debugSession.name === debugConfigArray[0].name) {
startDebugEvent.dispose();
vscode.debug.startDebugging(debugSession.workspaceFolder, debugConfigArray[1], debugSession);
}
});

return debugConfigArray[0];
} else if (debugConfigArray.length > 2) {
throw new InternalServiceError('Multiple launch targets (>2) is not yet supported.');
} else {
throw new InternalServiceError(
'Unexpected configuration array from IDotnetDebugConfigurationServiceResult.'
Expand Down

0 comments on commit a09f64a

Please sign in to comment.