Skip to content

Commit

Permalink
Snap main for C# prerelease 07/17 (#5927)
Browse files Browse the repository at this point in the history
* Increase release CI timeout

* Add CI for release branch

* Add eslint and fix warnings

* Implement report issue command for prerelease extension

* Update O# Roslyn and prepare for release

* Switch to non-deprecated action for asset upload

* Upload all VSIX in one step

* Update .github/workflows/release-ci.yml

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>

* Update release-ci.yml

* review feedback

* use vscode-uri

* Add write permissions to job

* Fix options schema

* Explicitly throw if runtimeId is missing

* Use real looking runtimeId in fake

* Use issue reporter command

* Add server path as an option to allow Razor to re-use the runtime resolver

* Fix brace

* More lint

* Update README.md to notify user about .NET Runtime Tool

* Enable full solution background analysis

- Adds 2 new background analysis scope options: one for compiler diagnostics and one for analyzer diagnostics
- Both the options allow the same set of values as in VS: Open documents, Entire solution, Current document and None (disabled). Currently, `Current document` option is not yet supported in LSP as we do not have a way to know which is the current active document in LSP server.
- Builds on top of dotnet/roslyn#68799
- Needs couple more Roslyn side changes as a follow-up: dotnet/roslyn#68797 and dotnet/roslyn#68798

* Remove the un-supported `Current Document` option

* File renames

* Remove TSLint and configure eslint

* Enable remaining rules from tslint and remove

* Run prettier automatic fixer

* address a couple remaining eslint errors

* Remove incorrectly cased folders

* Remove duplicate license header

* Fix options schema after package.json changes

* Fix chai test assertion library usages

* Avoid using 'solution crawler' terminology in the VSCode option name

* Address feedback and fix test

* Revert unintentional changes from merge

* Some more reverts

* Address feedback and also fix linting issues

* Revert "Merged PR 475885: Add support for F5 for csproj and sln" (#5875)

This reverts commit 173be18.

* Update README.md to make runtime extension note numbered

* Bump Razor to 7.0.0-preview.23328.2

* Allow updatePackageDependencies to work with Razor (well, with prerelease packages)

* Add task for updating Razor deps

* Move to newer version of Roslyn LSP server

* Remove unsupported feature

* Update regexes

* small edits to readme

* deleted extra space in readme

* Try a less recent Razor version

* Update roslyn

* Remove pwa- prefix from BlazorDebug (#5908)

This PR removes pwa- from msedge and chrome as this was an older debug
type that is now depricated.

See microsoft/vscode-js-debug#1305

* Add determineBrowserType to CSharpExtensionExports (#5911)

This PR exports the
BlazorDebugConfigurationProvider.determineBrowserType method that it
could be used in vscode-dotnettools to help determine the browser the
user wants to use.

* Bump semver from 5.6.0 to 5.7.2

Bumps [semver](https://github.com/npm/node-semver) from 5.6.0 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.6.0...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update debugger packages to 2.0.2 (#5914)

Co-authored-by: Isadora Rodopoulos <isgarcia@microsoft.com>

* Fix static variables used in determineBrowserType (#5919)

This PR fixes the 'this' to be 'BlazorDebugConfigurationProvider' for
the new static variables from #5911

* Add call to setupTelemetryEnvironmentAsync (#5922)

* Add call to setupTelemetryEnvironmentAsync

* Make optional

* Update Roslyn server (#5925)

* Update Roslyn server

* Update package.json

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: David Barbet <dabarbet@microsoft.com>
Co-authored-by: David Barbet <dibarbet@gmail.com>
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Co-authored-by: Joey Robichaud <jorobich@microsoft.com>
Co-authored-by: leslierichardson95 <LERICH@microsoft.com>
Co-authored-by: Manish Vasani <mavasani@microsoft.com>
Co-authored-by: Andrew Wang <waan@microsoft.com>
Co-authored-by: David Wengier <git@wengier.com>
Co-authored-by: Andrew Hall (METAL) <andrha@microsoft.com>
Co-authored-by: Mika Dumont <midumont@microsoft.com>
Co-authored-by: Mika Dumont <46729679+mikadumont@users.noreply.github.com>
Co-authored-by: David Wengier <david.wengier@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Isadora <isaecia@gmail.com>
Co-authored-by: Isadora Rodopoulos <isgarcia@microsoft.com>
  • Loading branch information
16 people committed Jul 18, 2023
1 parent 55ec0fb commit 4491904
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 39 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
},
"defaults": {
"roslyn": "4.8.0-1.23357.10",
"roslyn": "4.8.0-1.23367.7",
"omniSharp": "1.39.7",
"razor": "7.0.0-preview.23301.2"
},
Expand Down Expand Up @@ -85,7 +85,7 @@
"ps-list": "7.2.0",
"request-light": "0.4.0",
"rxjs": "6.6.7",
"semver": "5.6.0",
"semver": "5.7.2",
"stream": "0.0.2",
"strip-bom": "5.0.0",
"strip-bom-buf": "2.0.0",
Expand Down Expand Up @@ -433,7 +433,7 @@
{
"id": "Debugger",
"description": ".NET Core Debugger (Windows / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-win7-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-win7-x64.zip",
"installPath": ".debugger/x86_64",
"platforms": [
"win32"
Expand All @@ -443,12 +443,12 @@
"arm64"
],
"installTestPath": "./.debugger/x86_64/vsdbg-ui.exe",
"integrity": "F8EE956167EE6BCDB39EDB9E377F5C5EB06A50C56F85C9F77F7E8CEFAC2FA6E5"
"integrity": "5DB21D3C7C34E8E4A7029AF48FF9A20E6FBECB689626D559C0FA3C8C92CABAC1"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (Windows / ARM64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-win10-arm64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-win10-arm64.zip",
"installPath": ".debugger/arm64",
"platforms": [
"win32"
Expand All @@ -457,12 +457,12 @@
"arm64"
],
"installTestPath": "./.debugger/arm64/vsdbg-ui.exe",
"integrity": "053CD0366ACD224C7232E983FF3DB0E162C02148D0EDED60E247C1D50D8C2BC8"
"integrity": "A3CFF7D47EF5EEDE664E3011EC3B66221E0F7C24CE11D882EAA03B797B014605"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (macOS / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-osx-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-osx-x64.zip",
"installPath": ".debugger/x86_64",
"platforms": [
"darwin"
Expand All @@ -476,12 +476,12 @@
"./vsdbg"
],
"installTestPath": "./.debugger/x86_64/vsdbg-ui",
"integrity": "31FD387AE90A558057F7BF7A2D0E93C1080B0A11D170F5FB7D75928A98B49617"
"integrity": "EC2FFB22EC3449F9318CF38049AB394B0E759F8431AB93992A18EF8FF1601D0D"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (macOS / arm64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-osx-arm64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-osx-arm64.zip",
"installPath": ".debugger/arm64",
"platforms": [
"darwin"
Expand All @@ -494,12 +494,12 @@
"./vsdbg"
],
"installTestPath": "./.debugger/arm64/vsdbg-ui",
"integrity": "85D18DA22979AA5A1DB0B71C3C104F1E3DB1A67E8D69F3AF634543667853CB74"
"integrity": "2EB2AE4DDED16D725B5CF2536885E7D7E923CB42E8FB41AA166F78461B7E8AAE"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (linux / ARM)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-linux-arm.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-linux-arm.zip",
"installPath": ".debugger",
"platforms": [
"linux"
Expand All @@ -512,12 +512,12 @@
"./vsdbg"
],
"installTestPath": "./.debugger/vsdbg-ui",
"integrity": "1678AD79ABCEB767FCC9CD5B9CEA82A0A25EC7CC49E91CE45275D2556B3AB410"
"integrity": "9EDC86E00498E06EB82BC7C9B586F7213B22A9A4AE30C3F5A52D773CE7E8FDDA"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (linux / ARM64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-linux-arm64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-linux-arm64.zip",
"installPath": ".debugger",
"platforms": [
"linux"
Expand All @@ -530,12 +530,12 @@
"./vsdbg"
],
"installTestPath": "./.debugger/vsdbg-ui",
"integrity": "2685C26EEBC577985A843F97FD1EE8BC284C58F47B41D2AA2672860D059EDA5A"
"integrity": "F62995DA4AEDCE091AA1AE119BB948F6898EDAFA2EA9F99C9F1B0DD747E8B0C3"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (linux musl / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-linux-musl-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-linux-musl-x64.zip",
"installPath": ".debugger",
"platforms": [
"linux-musl"
Expand All @@ -548,12 +548,12 @@
"./vsdbg"
],
"installTestPath": "./.debugger/vsdbg-ui",
"integrity": "F11261E1ADEFEB31BDFCD677E510597C94CBCD45A76139DF37AA24D3B4221D1D"
"integrity": "FD711DC673870AF23B33C6C1AB933F5B7A9D943E1D58B6082B051172352141EE"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (linux musl / ARM64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-linux-musl-arm64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-linux-musl-arm64.zip",
"installPath": ".debugger",
"platforms": [
"linux-musl"
Expand All @@ -566,12 +566,12 @@
"./vsdbg"
],
"installTestPath": "./.debugger/vsdbg-ui",
"integrity": "25BB43CF3989A239288F6988A35C7EB96C9EC9729ECD886B0D630FB9D42CFAAF"
"integrity": "DA5A39BA645BF15374AE1BD87ADA5532C79578BC82451A99E2D67D5CD65008EE"
},
{
"id": "Debugger",
"description": ".NET Core Debugger (linux / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-1/coreclr-debug-linux-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-2-0-2/coreclr-debug-linux-x64.zip",
"installPath": ".debugger",
"platforms": [
"linux"
Expand All @@ -584,7 +584,7 @@
"./vsdbg"
],
"installTestPath": "./.debugger/vsdbg-ui",
"integrity": "26233E972BDDC41D22456DE1639E0B7028902D28CA83926A83432FFE8C6E654C"
"integrity": "CBFBDFF84D6EFECAA4096980DF37BAE3AFA09DAEDA000AB2212F588F28A89B47"
},
{
"id": "Razor",
Expand Down
2 changes: 1 addition & 1 deletion src/csharpDevKitExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export interface CSharpDevKitExports {
components: Readonly<{ [key: string]: string }>;
hasServerProcessLoaded: () => boolean;
serverProcessLoaded: vscode.Event<void>;
writeCommonPropsAsync: (context: vscode.ExtensionContext) => Promise<string | undefined>;
setupTelemetryEnvironmentAsync: (env: NodeJS.ProcessEnv) => Promise<string | undefined>;
}
1 change: 1 addition & 0 deletions src/csharpExtensionExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface CSharpExtensionExports {
initializationFinished: () => Promise<void>;
logDirectory: string;
profferBrokeredServices: (container: GlobalBrokeredServiceContainer) => void;
determineBrowserType: () => Promise<string | undefined>;
}
17 changes: 17 additions & 0 deletions src/lsptoolshost/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ export class RoslynLanguageServer {

const csharpDevkitArgs = await this.getCSharpDevkitExportArgs(csharpDevkitExtension, options);
args = args.concat(csharpDevkitArgs);

await this.setupDevKitEnvironment(env, csharpDevkitExtension);
} else {
// C# Dev Kit is not installed - continue C#-only activation.
_channel.appendLine('Activating C# standalone...');
Expand Down Expand Up @@ -528,6 +530,21 @@ export class RoslynLanguageServer {
return csharpIntelliCodeArgs;
}

private async setupDevKitEnvironment(
env: NodeJS.ProcessEnv,
csharpDevkitExtension: vscode.Extension<CSharpDevKitExports>
): Promise<void> {
const exports: CSharpDevKitExports = await csharpDevkitExtension.activate();

// setupTelemetryEnvironmentAsync was a later addition to devkit (not in preview 1)
// so it may not exist in whatever version of devkit the user has installed
if (!exports.setupTelemetryEnvironmentAsync) {
return;
}

await exports.setupTelemetryEnvironmentAsync(env);
}

private getLanguageServicesDevKitComponentPath(csharpDevKitExports: CSharpDevKitExports): string {
return path.join(
csharpDevKitExports.components['@microsoft/visualstudio-languageservices-devkit'],
Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import Descriptors from './lsptoolshost/services/descriptors';
import { GlobalBrokeredServiceContainer } from '@microsoft/servicehub-framework';
import { CSharpExtensionExports, OmnisharpExtensionExports } from './csharpExtensionExports';
import { csharpDevkitExtensionId, getCSharpDevKit } from './utils/getCSharpDevKit';
import { BlazorDebugConfigurationProvider } from './razor/src/blazorDebug/blazorDebugConfigurationProvider';

export async function activate(
context: vscode.ExtensionContext
Expand Down Expand Up @@ -288,6 +289,7 @@ export async function activate(
},
profferBrokeredServices: (container) => profferBrokeredServices(context, container),
logDirectory: context.logUri.fsPath,
determineBrowserType: BlazorDebugConfigurationProvider.determineBrowserType,
};
} else {
return {
Expand Down
28 changes: 17 additions & 11 deletions src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import showInformationMessage from '../../../shared/observers/utils/showInformat
import showErrorMessage from '../../../observers/utils/showErrorMessage';

export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurationProvider {
private readonly autoDetectUserNotice = `Run and Debug: auto-detection found {0} for a launch browser`;
private readonly edgeBrowserType = 'pwa-msedge';
private readonly chromeBrowserType = 'pwa-chrome';
private static readonly autoDetectUserNotice: string = `Run and Debug: auto-detection found {0} for a launch browser`;
private static readonly edgeBrowserType: string = 'msedge';
private static readonly chromeBrowserType: string = 'chrome';

constructor(private readonly logger: RazorLogger, private readonly vscodeType: typeof vscode) {}

Expand Down Expand Up @@ -125,10 +125,10 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
const configBrowser = configuration.browser;
const browserType =
configBrowser === 'edge'
? this.edgeBrowserType
? BlazorDebugConfigurationProvider.edgeBrowserType
: configBrowser === 'chrome'
? this.chromeBrowserType
: await this.determineBrowserType();
? BlazorDebugConfigurationProvider.chromeBrowserType
: await BlazorDebugConfigurationProvider.determineBrowserType();
if (!browserType) {
return;
}
Expand Down Expand Up @@ -172,21 +172,27 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati
}
}

private async determineBrowserType() {
public static async determineBrowserType(): Promise<string | undefined> {
// There was no browser specified by the user, so we will do some auto-detection to find a browser,
// favoring chrome if multiple valid options are installed.
const chromeBrowserFinder = new ChromeBrowserFinder(process.env, promises, null);
const chromeInstallations = await chromeBrowserFinder.findAll();
if (chromeInstallations.length > 0) {
showInformationMessage(vscode, this.autoDetectUserNotice.replace('{0}', `'Chrome'`));
return this.chromeBrowserType;
showInformationMessage(
vscode,
BlazorDebugConfigurationProvider.autoDetectUserNotice.replace('{0}', `'Chrome'`)
);
return BlazorDebugConfigurationProvider.chromeBrowserType;
}

const edgeBrowserFinder = new EdgeBrowserFinder(process.env, promises, null);
const edgeInstallations = await edgeBrowserFinder.findAll();
if (edgeInstallations.length > 0) {
showInformationMessage(vscode, this.autoDetectUserNotice.replace('{0}', `'Edge'`));
return this.edgeBrowserType;
showInformationMessage(
vscode,
BlazorDebugConfigurationProvider.autoDetectUserNotice.replace('{0}', `'Edge'`)
);
return BlazorDebugConfigurationProvider.edgeBrowserType;
}

showErrorMessage(vscode, 'Run and Debug: A valid browser is not installed');
Expand Down

0 comments on commit 4491904

Please sign in to comment.