Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Blazor WebAssembly notifications #4018

Merged
merged 1 commit into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
},
Expand Down Expand Up @@ -3491,4 +3496,4 @@
]
}
}
}
}
15 changes: 8 additions & 7 deletions src/omnisharp/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
}
Expand Down Expand Up @@ -234,11 +240,6 @@ async function isBlazorWebAssemblyProject(project: MSBuildProject): Promise<bool
}

function hasBlazorWebAssemblyDebugPrerequisites() {
const jsDebugExtension = vscode.extensions.getExtension('ms-vscode.js-debug-nightly');
if (!jsDebugExtension) {
return false;
}

const debugJavaScriptConfigSection = vscode.workspace.getConfiguration('debug.javascript');
const usePreviewValue = debugJavaScriptConfigSection.get('usePreview');
if (usePreviewValue) {
Expand Down