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

Prompt user to install Blazor WASM companion extension if needed #4392

Merged
merged 2 commits into from
Feb 11, 2021
Merged
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions src/omnisharp/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,19 @@ async function isBlazorWebAssemblyProject(project: MSBuildProject): Promise<bool
}

function hasBlazorWebAssemblyDebugPrerequisites() {
const companionExtension = vscode.extensions.getExtension('ms-dotnettools.blazorwasm-companion');
if (!companionExtension) {
const msg = 'The Blazor WASM Debugging Extension is required to debug Blazor WASM apps in VS Code.';
vscode.window.showInformationMessage(msg, 'Install Extension', 'Close')
.then(async result => {
if (result === 'Install Extension') {
const uriToOpen = vscode.Uri.parse('vscode:extension/ms-dotnettools.blazorwasm-companion');
await vscode.commands.executeCommand('vscode.open', uriToOpen);
}
});
return false;
}

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