Skip to content

Commit c14e928

Browse files
authored
Clean up Blazor WebAssembly notifications (#4018)
1 parent 3be36af commit c14e928

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,11 @@
835835
"scope": "window",
836836
"default": true,
837837
"description": "Enable/disable default Razor formatter."
838+
},
839+
"razor.disableBlazorDebugPrompt": {
840+
"type": "boolean",
841+
"default": false,
842+
"description": "Disable Blazor WebAssembly's debug requirements notification."
838843
}
839844
}
840845
},
@@ -3491,4 +3496,4 @@
34913496
]
34923497
}
34933498
}
3494-
}
3499+
}

src/omnisharp/utils.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,21 @@ export async function requestWorkspaceInformation(server: OmniSharpServer) {
9393
blazorWebAssemblyProjectFound = blazorWebAssemblyProjectFound || isProjectBlazorWebAssemblyProject;
9494
}
9595

96-
if (!blazorDetectionEnabled && blazorWebAssemblyProjectFound) {
96+
const configuration = vscode.workspace.getConfiguration('razor');
97+
const disableBlazorDebugPrompt = configuration.get('disableBlazorDebugPrompt');
98+
99+
if (!blazorDetectionEnabled && blazorWebAssemblyProjectFound && !disableBlazorDebugPrompt) {
97100
// There's a Blazor Web Assembly project but VSCode isn't configured to debug the WASM code, show a notification
98101
// to help the user configure their VSCode appropriately.
99-
vscode.window.showInformationMessage('Additional setup is required to debug Blazor WebAssembly applications.', 'Learn more', 'Close')
102+
vscode.window.showInformationMessage('Additional setup is required to debug Blazor WebAssembly applications.', 'Don\'t Ask Again', 'Learn more', 'Close')
100103
.then(async result => {
101104
if (result === 'Learn more') {
102105
const uriToOpen = vscode.Uri.parse('https://aka.ms/blazordebugging#vscode');
103106
await vscode.commands.executeCommand('vscode.open', uriToOpen);
104107
}
108+
if (result === 'Don\'t Ask Again') {
109+
await configuration.update('disableBlazorDebugPrompt', true);
110+
}
105111
});
106112
}
107113
}
@@ -234,11 +240,6 @@ async function isBlazorWebAssemblyProject(project: MSBuildProject): Promise<bool
234240
}
235241

236242
function hasBlazorWebAssemblyDebugPrerequisites() {
237-
const jsDebugExtension = vscode.extensions.getExtension('ms-vscode.js-debug-nightly');
238-
if (!jsDebugExtension) {
239-
return false;
240-
}
241-
242243
const debugJavaScriptConfigSection = vscode.workspace.getConfiguration('debug.javascript');
243244
const usePreviewValue = debugJavaScriptConfigSection.get('usePreview');
244245
if (usePreviewValue) {

0 commit comments

Comments
 (0)