Skip to content

Commit 0d2162d

Browse files
authored
Register Blazor WASM debugger in cohosting (#8511)
2 parents 15d3bb7 + 5caaa59 commit 0d2162d

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
55

66
# 2.89.x
7+
* Register Blazor WASM debugger in Razor Cohosting (PR: [#8511](https://github.com/dotnet/vscode-csharp/pull/8511))
78
* Bump Razor to 10.0.0-preview.25411.5 (PR: [#8512](https://github.com/dotnet/vscode-csharp/pull/8512))
89
* Fix VS Code cohosting completion when Razor and C# are valid (PR: [#12096](https://github.com/dotnet/razor/pull/12096))
910
* Fix null reference exception in formatting (PR: [#12097](https://github.com/dotnet/razor/pull/12097))

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)