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

Blazor WASM Debug Proxy Updates #5885

Merged
20 commits merged into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
Refactoring
  • Loading branch information
TanayParikh committed Dec 17, 2021
commit 651831579cccd39fad89e50cf608f70d4772415f
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Microsoft.AspNetCore.Razor.VSCode.BlazorWasmDebuggingExtension

**Warning:** This extension is indeed for use alongside the C# extension.
**Warning:** This extension is intended for use alongside the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).

This directory contains the code for the Blazor WebAssembly Debugging extension. This extension is designed to support debugging scenarios for Blazor WebAssembly.

Expand All @@ -27,6 +27,6 @@ This extension bundles the debugging proxy assets that are needed inside the `Bl
1. Generate a personal access token per the instructions in [the VS Code publishing guide](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page).
2. Store the token from #1 in the `VSCODE_MARKETPLACE_TOKEN` environment variable.
3. Increment the `patch` version of the package in the `package.json` file.
4. Open a PR to the aspnetcore-tooling repo.
4. Open a PR to the razor-tooling repo.
5. Download the VSIX asset from the artifiacts of the build.
6. Publish the VSIX asset using `vsix publish --packagePath ${pathFrom5} -p $VSCODE_MARKETPLACE_TOKEN`.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This is a companion extension to the [C# extension](https://marketplace.visualst

For more information on Blazor, visit the [Blazor homepage](https://blazor.net).

For more information on debugging Blazor WebAssembly applications, vist our official documentation page on [debugging Blazor WASM](https://docs.microsoft.com/en-us/aspnet/core/blazor/debug).
For more information on debugging Blazor WebAssembly applications, vist our official documentation page on [debugging Blazor WASM](https://docs.microsoft.com/aspnet/core/blazor/debug).
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "1.1.1",
"repository": {
"type": "git",
"url": "https://github.com/dotnet/aspnetcore-tooling.git"
"url": "https://github.com/dotnet/razor-tooling.git"
},
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -55,12 +55,12 @@
"@types/vscode": "^1.52.0",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"tslint": "^5.11.0",
"extract-zip": "^2.0.1",
"glob": "^7.1.6",
"mocha": "^8.1.3",
"node-fetch": "^2.6.1",
"rimraf": "2.6.3",
"tslint": "^5.11.0",
"typescript": "^4.1.2",
"vscode-test": "^1.4.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */

import * as vscode from 'vscode';
import { OutputChannel, extensions, commands } from 'vscode';

interface IDotnetAcquireResult {
dotnetPath: string;
}

export async function acquireDotnetInstall(outputChannel: vscode.OutputChannel): Promise<string> {
const extension = vscode.extensions.getExtension('ms-dotnettools.blazorwasm-companion');
const version = extension && extension.packageJSON ? extension.packageJSON.dotnetRuntimeVersion : '5.0';
export async function acquireDotnetInstall(outputChannel: OutputChannel): Promise<string> {
const extension = extensions.getExtension('ms-dotnettools.blazorwasm-companion');
const version = extension && extension.packageJSON ? extension.packageJSON.dotnetRuntimeVersion : '6.0';
const requestingExtensionId = 'blazorwasm-companion';

try {
const dotnetResult = await vscode.commands.executeCommand<IDotnetAcquireResult>('dotnet.acquire', { version, requestingExtensionId });
const dotnetResult = await commands.executeCommand<IDotnetAcquireResult>('dotnet.acquire', { version, requestingExtensionId });
const dotnetPath = dotnetResult?.dotnetPath;
if (!dotnetPath) {
throw new Error('Install step returned an undefined path.');
}
await vscode.commands.executeCommand('dotnet.ensureDotnetDependencies', { command: dotnetPath, arguments: ['--info'] });
await commands.executeCommand('dotnet.ensureDotnetDependencies', { command: dotnetPath, arguments: ['--info'] });
return dotnetPath;
} catch (err) {
} catch (err: any) {
const message = err.msg;
outputChannel.appendLine(`This extension requires .NET Core to run but we were unable to install it due to the following error:`);
outputChannel.appendLine(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export async function activate(context: vscode.ExtensionContext) {
hostEventStream,
/* enabledProposedApis */true);
} else {
console.log('Razor workspace was not configured, extension activation skipped.');
console.log('To configure your workspace run the following command (ctrl+shift+p) in the experimental instance "Razor: Configure workspace for Razor extension development"');
console.warn('Razor workspace was not configured, extension activation skipped.');
console.warn('To configure your workspace run the following command (ctrl+shift+p) in the experimental instance "Razor: Configure workspace for Razor extension development"');
}

activationResolver();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
});
}
} catch (error) {
this.logger.logError('[DEBUGGER] Error when launching application: ', error);
this.logger.logError('[DEBUGGER] Error when launching application: ', error as Error);
}
}

Expand Down Expand Up @@ -120,7 +120,7 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
} catch (error) {
this.logger.logError(
'[DEBUGGER] Error when launching browser debugger: ',
error,
error as Error,
);
const message = `There was an unexpected error while launching your debugging session. Check the console for helpful logs and visit the debugging docs for more info.`;
this.vscodeType.window.showErrorMessage(message, `View Debug Docs`, `Ignore`).then(async result => {
Expand Down
16 changes: 8 additions & 8 deletions src/Razor/src/Microsoft.AspNetCore.Razor.VSCode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"./src/**/*"
]
}
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"./src/**/*"
]
}