Skip to content

Commit

Permalink
Merge pull request #4392 from captainsafia/safia/add-dependency-check
Browse files Browse the repository at this point in the history
Prompt user to install Blazor WASM companion extension if needed
  • Loading branch information
JoeRobich authored Feb 11, 2021
2 parents 273c95e + d81f22c commit 0938f0f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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
6 changes: 6 additions & 0 deletions test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ To setup a test project to verify on you can do:

##### Debugging with blazorwasm debug adapter

**Note:** On a VS Code installation with no extensions, you should recieve an alert like the following:

> The Blazor WASM Debugging Extension is required to debug Blazor WASM apps in VS Code.
Press "Install Extension" before step 2 in each of the test scenarios below.

###### Standalone app

To set up a test project to verify on, create a new Blazor WebAssembly application using the dotnet CLI.
Expand Down

0 comments on commit 0938f0f

Please sign in to comment.