From 8ef748875ad042e8d4385c92364e143fe2f6e4f8 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 25 Aug 2020 15:32:33 -0700 Subject: [PATCH] Clean up Blazor WebAssembly notifications --- package.json | 7 ++++++- src/omnisharp/utils.ts | 15 ++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 3d936b72a..0b44fda7b 100644 --- a/package.json +++ b/package.json @@ -835,6 +835,11 @@ "scope": "window", "default": true, "description": "Enable/disable default Razor formatter." + }, + "razor.disableBlazorDebugPrompt": { + "type": "boolean", + "default": false, + "description": "Disable Blazor WebAssembly's debug requirements notification." } } }, @@ -3491,4 +3496,4 @@ ] } } -} +} \ No newline at end of file diff --git a/src/omnisharp/utils.ts b/src/omnisharp/utils.ts index 873d7e198..2c02be62b 100644 --- a/src/omnisharp/utils.ts +++ b/src/omnisharp/utils.ts @@ -93,15 +93,21 @@ export async function requestWorkspaceInformation(server: OmniSharpServer) { blazorWebAssemblyProjectFound = blazorWebAssemblyProjectFound || isProjectBlazorWebAssemblyProject; } - if (!blazorDetectionEnabled && blazorWebAssemblyProjectFound) { + const configuration = vscode.workspace.getConfiguration('razor'); + const disableBlazorDebugPrompt = configuration.get('disableBlazorDebugPrompt'); + + if (!blazorDetectionEnabled && blazorWebAssemblyProjectFound && !disableBlazorDebugPrompt) { // There's a Blazor Web Assembly project but VSCode isn't configured to debug the WASM code, show a notification // to help the user configure their VSCode appropriately. - vscode.window.showInformationMessage('Additional setup is required to debug Blazor WebAssembly applications.', 'Learn more', 'Close') + vscode.window.showInformationMessage('Additional setup is required to debug Blazor WebAssembly applications.', 'Don\'t Ask Again', 'Learn more', 'Close') .then(async result => { if (result === 'Learn more') { const uriToOpen = vscode.Uri.parse('https://aka.ms/blazordebugging#vscode'); await vscode.commands.executeCommand('vscode.open', uriToOpen); } + if (result === 'Don\'t Ask Again') { + await configuration.update('disableBlazorDebugPrompt', true); + } }); } } @@ -234,11 +240,6 @@ async function isBlazorWebAssemblyProject(project: MSBuildProject): Promise