Skip to content

Commit fbe5a6d

Browse files
committed
Register Blazor WASM debugger in cohosting
1 parent 4cb5e00 commit fbe5a6d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/lsptoolshost/razor/razorEndpoints.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import { FormattingHandler } from '../../razor/src/formatting/formattingHandler'
5252
import { ReportIssueCommand } from '../../razor/src/diagnostics/reportIssueCommand';
5353
import { HtmlDocument } from './htmlDocument';
5454
import { HtmlForwardedRequest } from './htmlForwardedRequest';
55+
import { BlazorDebugConfigurationProvider } from '../../razor/src/blazorDebug/blazorDebugConfigurationProvider';
5556

5657
export function registerRazorEndpoints(
5758
context: vscode.ExtensionContext,
@@ -67,6 +68,8 @@ export function registerRazorEndpoints(
6768
if (razorOptions.cohostingEnabled) {
6869
vscode.commands.executeCommand('setContext', 'razor.mode', 'cohosting');
6970
registerCohostingEndpoints();
71+
72+
context.subscriptions.push(BlazorDebugConfigurationProvider.register(razorLogger, vscode));
7073
} else {
7174
vscode.commands.executeCommand('setContext', 'razor.mode', 'lsp');
7275
registerNonCohostingEndpoints();

src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
2323

2424
constructor(private readonly logger: RazorLogger, private readonly vscodeType: typeof vscode) {}
2525

26+
public static register(logger: RazorLogger, vscodeType: typeof vscode) {
27+
const provider = new BlazorDebugConfigurationProvider(logger, vscodeType);
28+
return vscodeType.debug.registerDebugConfigurationProvider('blazorwasm', provider);
29+
}
30+
2631
public async resolveDebugConfiguration(
2732
folder: vscode.WorkspaceFolder | undefined,
2833
configuration: vscode.DebugConfiguration

src/razor/src/extension.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ export async function activate(
310310
localRegistrations.length = 0;
311311
});
312312

313-
const provider = new BlazorDebugConfigurationProvider(logger, vscodeType);
314-
context.subscriptions.push(vscodeType.debug.registerDebugConfigurationProvider('blazorwasm', provider));
313+
context.subscriptions.push(BlazorDebugConfigurationProvider.register(logger, vscodeType));
315314

316315
languageServerClient.onStarted(async () => {
317316
await documentManager.initialize();

0 commit comments

Comments
 (0)