From 4491904f21f73c5d0a24694d1e81ac50d484e4ee Mon Sep 17 00:00:00 2001 From: Arun Chander Date: Mon, 17 Jul 2023 17:56:03 -0700 Subject: [PATCH] Snap main for C# prerelease 07/17 (#5927) * 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 * 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 https://github.com/dotnet/roslyn/pull/68799 - Needs couple more Roslyn side changes as a follow-up: https://github.com/dotnet/roslyn/issues/68797 and https://github.com/dotnet/roslyn/issues/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 173be18fd37ee88b53214a13b4b574507cc6ec34. * 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 https://github.com/microsoft/vscode-js-debug/pull/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](https://github.com/npm/node-semver/compare/v5.6.0...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Update debugger packages to 2.0.2 (#5914) Co-authored-by: Isadora Rodopoulos * Fix static variables used in determineBrowserType (#5919) This PR fixes the 'this' to be 'BlazorDebugConfigurationProvider' for the new static variables from https://github.com/dotnet/vscode-csharp/pull/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] Co-authored-by: David Barbet Co-authored-by: David Barbet Co-authored-by: Joey Robichaud Co-authored-by: Joey Robichaud Co-authored-by: leslierichardson95 Co-authored-by: Manish Vasani Co-authored-by: Andrew Wang Co-authored-by: David Wengier Co-authored-by: Andrew Hall (METAL) Co-authored-by: Mika Dumont Co-authored-by: Mika Dumont <46729679+mikadumont@users.noreply.github.com> Co-authored-by: David Wengier Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Isadora Co-authored-by: Isadora Rodopoulos --- package-lock.json | 14 +++---- package.json | 40 +++++++++---------- src/csharpDevKitExports.ts | 2 +- src/csharpExtensionExports.ts | 1 + src/lsptoolshost/roslynLanguageServer.ts | 17 ++++++++ src/main.ts | 2 + .../blazorDebugConfigurationProvider.ts | 28 ++++++++----- 7 files changed, 65 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 092878625..e78b889f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,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", @@ -9929,9 +9929,9 @@ } }, "node_modules/semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "bin": { "semver": "bin/semver" } @@ -19953,9 +19953,9 @@ } }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" }, "semver-greatest-satisfied-range": { "version": "1.1.0", diff --git a/package.json b/package.json index 10b9c30a2..d018d4dbf 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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", @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -584,7 +584,7 @@ "./vsdbg" ], "installTestPath": "./.debugger/vsdbg-ui", - "integrity": "26233E972BDDC41D22456DE1639E0B7028902D28CA83926A83432FFE8C6E654C" + "integrity": "CBFBDFF84D6EFECAA4096980DF37BAE3AFA09DAEDA000AB2212F588F28A89B47" }, { "id": "Razor", diff --git a/src/csharpDevKitExports.ts b/src/csharpDevKitExports.ts index 985cad757..696b43c65 100644 --- a/src/csharpDevKitExports.ts +++ b/src/csharpDevKitExports.ts @@ -13,5 +13,5 @@ export interface CSharpDevKitExports { components: Readonly<{ [key: string]: string }>; hasServerProcessLoaded: () => boolean; serverProcessLoaded: vscode.Event; - writeCommonPropsAsync: (context: vscode.ExtensionContext) => Promise; + setupTelemetryEnvironmentAsync: (env: NodeJS.ProcessEnv) => Promise; } diff --git a/src/csharpExtensionExports.ts b/src/csharpExtensionExports.ts index 9a6ce0a74..1d4b879e5 100644 --- a/src/csharpExtensionExports.ts +++ b/src/csharpExtensionExports.ts @@ -20,4 +20,5 @@ export interface CSharpExtensionExports { initializationFinished: () => Promise; logDirectory: string; profferBrokeredServices: (container: GlobalBrokeredServiceContainer) => void; + determineBrowserType: () => Promise; } diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 35f42d2b4..4bba7fc42 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -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...'); @@ -528,6 +530,21 @@ export class RoslynLanguageServer { return csharpIntelliCodeArgs; } + private async setupDevKitEnvironment( + env: NodeJS.ProcessEnv, + csharpDevkitExtension: vscode.Extension + ): Promise { + 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'], diff --git a/src/main.ts b/src/main.ts index 5248d50b7..dab3185b1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 @@ -288,6 +289,7 @@ export async function activate( }, profferBrokeredServices: (container) => profferBrokeredServices(context, container), logDirectory: context.logUri.fsPath, + determineBrowserType: BlazorDebugConfigurationProvider.determineBrowserType, }; } else { return { diff --git a/src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts b/src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts index 5f0582bde..163d5f355 100644 --- a/src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts +++ b/src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts @@ -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) {} @@ -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; } @@ -172,21 +172,27 @@ export class BlazorDebugConfigurationProvider implements vscode.DebugConfigurati } } - private async determineBrowserType() { + public static async determineBrowserType(): Promise { // 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');