From bfd18fcdab1dc8c1b465b94776bdbd408ee10a8e Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Wed, 13 Sep 2023 12:43:08 -0700 Subject: [PATCH 1/9] Preliminary implementation --- package.json | 16 +++++- src/main.ts | 18 +++++++ .../downloadAndInstallPackages.ts | 20 ++++---- src/razor/razor.ts | 11 +++- src/razor/razorTelemetryDownloader.ts | 51 +++++++++++++++++++ src/razor/src/extension.ts | 13 +++-- src/razor/src/razorLanguageServerClient.ts | 37 ++++++++++++-- 7 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 src/razor/razorTelemetryDownloader.ts diff --git a/package.json b/package.json index 1d3a1c0ea..796faa672 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "roslyn": "4.8.0-3.23458.4", "omniSharp": "1.39.7", "razor": "7.0.0-preview.23456.2", - "razorOmnisharp": "7.0.0-preview.23363.1" + "razorOmnisharp": "7.0.0-preview.23363.1", + "razorTelemetry": "test" }, "main": "./dist/extension", "l10n": "./l10n", @@ -870,6 +871,19 @@ "binaries": [ "./rzls" ] + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Windows / x64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/03693d2c-3eed-4801-8de8-c71e3ecb3418/e7c8bc1e2881be443f282f19f656ad94/devkittelemetry-win-x64.zip", + "installPath": ".razor/telemetry", + "platforms": [ + "win32" + ], + "architectures": [ + "x86_64" + ], + "integrity": "2776B6967DE613C03B2EFEA9490D8B82BDF23E435FE7C6167D6A3ED58EC706ED" } ], "engines": { diff --git a/src/main.ts b/src/main.ts index 667e3a85d..e1f1a8480 100644 --- a/src/main.ts +++ b/src/main.ts @@ -56,6 +56,7 @@ import { registerOmnisharpOptionChanges } from './omnisharp/omnisharpOptionChang import { RoslynLanguageServerEvents } from './lsptoolshost/languageServerEvents'; import { ServerStateChange } from './lsptoolshost/serverStateChange'; import { SolutionSnapshotProvider } from './lsptoolshost/services/solutionSnapshotProvider'; +import { RazorTelemetryDownloader } from './razor/razorTelemetryDownloader'; export async function activate( context: vscode.ExtensionContext @@ -126,6 +127,21 @@ export async function activate( let projectInitializationCompletePromise: Promise | undefined = undefined; if (!useOmnisharpServer) { + // Download Razor server telemetry bits if DevKit is installed. + if (csharpDevkitExtension) { + const razorTelemetryDownloader = new RazorTelemetryDownloader( + networkSettingsProvider, + eventStream, + context.extension.packageJSON, + platformInfo, + context.extension.extensionPath + ); + + await razorTelemetryDownloader.DownloadAndInstallRazorTelemetry( + context.extension.packageJSON.defaults.razorTelemetry + ); + } + // Activate Razor. Needs to be activated before Roslyn so commands are registered in the correct order. // Otherwise, if Roslyn starts up first, they could execute commands that don't yet exist on Razor's end. // @@ -138,6 +154,7 @@ export async function activate( context, context.extension.extensionPath, eventStream, + reporter, /* useOmnisharpServer */ false ); @@ -274,6 +291,7 @@ export async function activate( context, context.extension.extensionPath, eventStream, + reporter, /* useOmnisharpServer */ true ); } diff --git a/src/packageManager/downloadAndInstallPackages.ts b/src/packageManager/downloadAndInstallPackages.ts index 7a35a0a52..29d612e9d 100644 --- a/src/packageManager/downloadAndInstallPackages.ts +++ b/src/packageManager/downloadAndInstallPackages.ts @@ -11,7 +11,7 @@ import { EventStream } from '../eventStream'; import { NetworkSettingsProvider } from '../networkSettings'; import { AbsolutePathPackage } from './absolutePathPackage'; import { touchInstallFile, InstallFileType, deleteInstallFile, installFileExists } from '../common'; -import { InstallationFailure, IntegrityCheckFailure } from '../omnisharp/loggingEvents'; +import { InstallationFailure } from '../omnisharp/loggingEvents'; import { mkdirpSync } from 'fs-extra'; import { PackageInstallStart } from '../omnisharp/loggingEvents'; import { DownloadValidator } from './isValidDownload'; @@ -34,15 +34,15 @@ export async function downloadAndInstallPackages( count = count + 1; installationStage = 'downloadPackage'; const buffer = await DownloadFile(pkg.description, eventStream, provider, pkg.url, pkg.fallbackUrl); - if (downloadValidator(buffer, pkg.integrity, eventStream)) { - installationStage = 'installPackage'; - await InstallZip(buffer, pkg.description, pkg.installPath, pkg.binaries, eventStream); - installationStage = 'touchLockFile'; - await touchInstallFile(pkg.installPath, InstallFileType.Lock); - break; - } else { - eventStream.post(new IntegrityCheckFailure(pkg.description, pkg.url, willTryInstallingPackage())); - } + //if (downloadValidator(buffer, pkg.integrity, eventStream)) { + installationStage = 'installPackage'; + await InstallZip(buffer, pkg.description, pkg.installPath, pkg.binaries, eventStream); + installationStage = 'touchLockFile'; + await touchInstallFile(pkg.installPath, InstallFileType.Lock); + break; + //} else { + // eventStream.post(new IntegrityCheckFailure(pkg.description, pkg.url, willTryInstallingPackage())); + //} } } catch (error) { if (error instanceof NestedError) { diff --git a/src/razor/razor.ts b/src/razor/razor.ts index 862e7d16b..351ea2441 100644 --- a/src/razor/razor.ts +++ b/src/razor/razor.ts @@ -9,11 +9,13 @@ import * as path from 'path'; import * as vscode from 'vscode'; import * as Razor from '../../src/razor/src/extension'; import { EventStream } from '../eventStream'; +import TelemetryReporter from '@vscode/extension-telemetry'; export async function activateRazorExtension( context: vscode.ExtensionContext, extensionPath: string, eventStream: EventStream, + vscodeTelemetryReporter: TelemetryReporter, useOmnisharpServer: boolean ) { const razorConfig = vscode.workspace.getConfiguration('razor'); @@ -35,7 +37,14 @@ export async function activateRazorExtension( /* enableProposedApis: */ false ); } else { - await Razor.activate(vscode, context, languageServerDir, eventStream, /* enableProposedApis: */ false); + await Razor.activate( + vscode, + context, + languageServerDir, + eventStream, + vscodeTelemetryReporter, + /* enableProposedApis: */ false + ); } } else { vscode.window.showWarningMessage( diff --git a/src/razor/razorTelemetryDownloader.ts b/src/razor/razorTelemetryDownloader.ts new file mode 100644 index 000000000..c3ad95e7c --- /dev/null +++ b/src/razor/razorTelemetryDownloader.ts @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { PlatformInformation } from '../shared/platform'; +import { PackageInstallation, LogPlatformInfo, InstallationSuccess } from '../omnisharp/loggingEvents'; +import { EventStream } from '../eventStream'; +import { NetworkSettingsProvider } from '../networkSettings'; +import { downloadAndInstallPackages } from '../packageManager/downloadAndInstallPackages'; +import { getRuntimeDependenciesPackages } from '../tools/runtimeDependencyPackageUtils'; +import { getAbsolutePathPackagesToInstall } from '../packageManager/getAbsolutePathPackagesToInstall'; +import { isValidDownload } from '../packageManager/isValidDownload'; + +export class RazorTelemetryDownloader { + public constructor( + private networkSettingsProvider: NetworkSettingsProvider, + private eventStream: EventStream, + private packageJSON: any, + private platformInfo: PlatformInformation, + private extensionPath: string + ) {} + + public async DownloadAndInstallRazorTelemetry(version: string): Promise { + const runtimeDependencies = getRuntimeDependenciesPackages(this.packageJSON); + const razorPackages = runtimeDependencies.filter((inputPackage) => inputPackage.id === 'RazorTelemetry'); + const packagesToInstall = await getAbsolutePathPackagesToInstall( + razorPackages, + this.platformInfo, + this.extensionPath + ); + + if (packagesToInstall.length > 0) { + this.eventStream.post(new PackageInstallation(`Razor Telemetry Version = ${version}`)); + this.eventStream.post(new LogPlatformInfo(this.platformInfo)); + if ( + await downloadAndInstallPackages( + packagesToInstall, + this.networkSettingsProvider, + this.eventStream, + isValidDownload + ) + ) { + this.eventStream.post(new InstallationSuccess()); + return true; + } + } + + return false; + } +} diff --git a/src/razor/src/extension.ts b/src/razor/src/extension.ts index 2ef7ef004..0633be429 100644 --- a/src/razor/src/extension.ts +++ b/src/razor/src/extension.ts @@ -41,9 +41,10 @@ import { RazorReferenceProvider } from './reference/razorReferenceProvider'; import { RazorRenameProvider } from './rename/razorRenameProvider'; import { SemanticTokensRangeHandler } from './semantic/semanticTokensRangeHandler'; import { RazorSignatureHelpProvider } from './signatureHelp/razorSignatureHelpProvider'; -import { TelemetryReporter } from './telemetryReporter'; +import { TelemetryReporter as RazorTelemetryReporter } from './telemetryReporter'; import { RazorDiagnosticHandler } from './diagnostics/razorDiagnosticHandler'; import { RazorSimplifyMethodHandler } from './simplify/razorSimplifyMethodHandler'; +import TelemetryReporter from '@vscode/extension-telemetry'; // We specifically need to take a reference to a particular instance of the vscode namespace, // otherwise providers attempt to operate on the null extension. @@ -52,9 +53,10 @@ export async function activate( context: ExtensionContext, languageServerDir: string, eventStream: HostEventStream, + vscodeTelemetryReporter: TelemetryReporter, enableProposedApis = false ) { - const telemetryReporter = new TelemetryReporter(eventStream); + const razorTelemetryReporter = new RazorTelemetryReporter(eventStream); const eventEmitterFactory: IEventEmitterFactory = { create: () => new vscode.EventEmitter(), }; @@ -66,14 +68,15 @@ export async function activate( const languageServerClient = new RazorLanguageServerClient( vscodeType, languageServerDir, - telemetryReporter, + razorTelemetryReporter, + vscodeTelemetryReporter, logger ); const languageServiceClient = new RazorLanguageServiceClient(languageServerClient); const documentManager = new RazorDocumentManager(languageServerClient, logger); const documentSynchronizer = new RazorDocumentSynchronizer(documentManager, logger); - reportTelemetryForDocuments(documentManager, telemetryReporter); + reportTelemetryForDocuments(documentManager, razorTelemetryReporter); const languageConfiguration = new RazorLanguageConfiguration(); const csharpFeature = new RazorCSharpFeature(documentManager, eventEmitterFactory, logger); const htmlFeature = new RazorHtmlFeature(documentManager, languageServiceClient, eventEmitterFactory, logger); @@ -252,7 +255,7 @@ export async function activate( context.subscriptions.push(languageServerClient, onStopRegistration, logger); } catch (error) { logger.logError('Failed when activating Razor VSCode.', error as Error); - telemetryReporter.reportErrorOnActivation(error as Error); + razorTelemetryReporter.reportErrorOnActivation(error as Error); } } diff --git a/src/razor/src/razorLanguageServerClient.ts b/src/razor/src/razorLanguageServerClient.ts index 107bfeecf..f4c273813 100644 --- a/src/razor/src/razorLanguageServerClient.ts +++ b/src/razor/src/razorLanguageServerClient.ts @@ -13,7 +13,9 @@ import { RazorLanguageServerOptions } from './razorLanguageServerOptions'; import { resolveRazorLanguageServerOptions } from './razorLanguageServerOptionsResolver'; import { resolveRazorLanguageServerTrace } from './razorLanguageServerTraceResolver'; import { RazorLogger } from './razorLogger'; -import { TelemetryReporter } from './telemetryReporter'; +import { TelemetryReporter as RazorTelemetryReporter } from './telemetryReporter'; +import TelemetryReporter from '@vscode/extension-telemetry'; +import { randomUUID } from 'crypto'; const events = { ServerStop: 'ServerStop', @@ -33,7 +35,8 @@ export class RazorLanguageServerClient implements vscode.Disposable { constructor( private readonly vscodeType: typeof vscode, private readonly languageServerDir: string, - private readonly telemetryReporter: TelemetryReporter, + private readonly razorTelemetryReporter: RazorTelemetryReporter, + private readonly vscodeTelemetryReporter: TelemetryReporter, private readonly logger: RazorLogger ) { this.isStarted = false; @@ -128,7 +131,7 @@ export class RazorLanguageServerClient implements vscode.Disposable { ) ); - this.telemetryReporter.reportErrorOnServerStart(error as Error); + this.razorTelemetryReporter.reportErrorOnServerStart(error as Error); reject(error); } @@ -233,10 +236,10 @@ export class RazorLanguageServerClient implements vscode.Disposable { args.push('--trace'); args.push(options.trace.toString()); - this.telemetryReporter.reportTraceLevel(options.trace); + this.razorTelemetryReporter.reportTraceLevel(options.trace); if (options.debug) { - this.telemetryReporter.reportDebugLanguageServer(); + this.razorTelemetryReporter.reportDebugLanguageServer(); this.logger.logMessage('Debug flag set for Razor Language Server.'); args.push('--debug'); @@ -250,6 +253,17 @@ export class RazorLanguageServerClient implements vscode.Disposable { args.push('true'); args.push('--UpdateBuffersForClosedDocuments'); args.push('true'); + + args.push('--telemetryLevel', this.vscodeTelemetryReporter.telemetryLevel); + args.push('--sessionId', getSessionId()); + args.push( + '--extension', + 'C:/Users/allichou/razor/artifacts/bin/Microsoft.VisualStudio.DevKit.Razor/Debug/net7.0/Microsoft.VisualStudio.DevKit.Razor.dll' + ); + args.push( + '--sharedDependencies', + 'C:/Users/allichou/razor/artifacts/bin/Microsoft.VisualStudio.DevKit.Razor/Debug/net7.0/' + ); } this.serverOptions = { command, args }; @@ -261,3 +275,16 @@ export class RazorLanguageServerClient implements vscode.Disposable { ); } } + +// VS code will have a default session id when running under tests. Since we may still +// report telemetry, we need to give a unique session id instead of the default value. +function getSessionId(): string { + const sessionId = vscode.env.sessionId; + + // 'somevalue.sessionid' is the test session id provided by vs code + if (sessionId.toLowerCase() === 'somevalue.sessionid') { + return randomUUID(); + } + + return sessionId; +} From 267bdf6daf4ab52a323f0f921b944c2b4f3c7a8c Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Thu, 14 Sep 2023 16:50:29 -0700 Subject: [PATCH 2/9] Fix telemetry downloading --- .gitignore | 1 + .vscode/launch.json | 20 ++- .vscodeignore | 1 + package.json | 150 +++++++++++++++--- .../downloadAndInstallPackages.ts | 20 +-- src/razor/src/razorLanguageServerClient.ts | 9 +- src/tools/updatePackageDependencies.ts | 2 +- 7 files changed, 159 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 327e0f807..d33e035e1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ out .debugger/ .razor/ .razoromnisharp/ +.razortelemetry/ .vscode-test/ dist/ *.razor.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 2741d1980..fb1f53db4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -290,13 +290,29 @@ "updatePackageDependencies" ], "env": { - "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/af4c33cdb53e85a7de39fb07195e05b2/razorlanguageserver-linux-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/24783517c9a4729efbd7dfd2a97fe5cc/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/e5e12ac99072e02499bef77c2c5034a2/razorlanguageserver-linux-musl-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/86a165500517ca828227bfd0f28f7a02/razorlanguageserver-linux-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d61e51f223e6bfeceae821b1cce36bfc/razorlanguageserver-osx-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/b9ee27ddd84b0f4faf82e88589c8584f/razorlanguageserver-osx-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d279c139e3d914fec96dfab50f05f438/razorlanguageserver-win-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/258d3df59cb903ca4bcb9d42b854e28b/razorlanguageserver-win-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d2ffb8978958712807d88ebf38914f47/razorlanguageserver-win-x86-7.0.0-preview.23456.2.zip", - "NEW_DEPS_VERSION": "7.0.0-preview.23456.2", + "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7a4d697a06da6cb992c591b44fccfb11/razorlanguageserver-linux-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/1fa089d63cde8d21ec9ca873b1948bb0/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/a8d0a6bc9b1c4e6f1e8ed349e302e9fd/razorlanguageserver-linux-musl-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/67c53310d6c7b4e729880fd94ccce9ab/razorlanguageserver-linux-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/a158413d1af07f98d7f753775848978a/razorlanguageserver-osx-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/cfb24346501d78bc55d0b7521c7e62cb/razorlanguageserver-osx-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/24717a2d1651eb44995e788cad626864/razorlanguageserver-win-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/fa09591c372229aedafd03203799c783/razorlanguageserver-win-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/ed87299705f127a3dbde56397318860d/razorlanguageserver-win-x86-7.0.0-preview.23464.2.zip", + "NEW_DEPS_VERSION": "7.0.0-preview.23464.2", "NEW_DEPS_ID": "Razor" }, "cwd": "${workspaceFolder}" }, { + "type": "node", + "request": "launch", + "name": "Update razor telemetry package dependencies", + "preLaunchTask": "build", + "program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js", + "args": [ + "updatePackageDependencies" + ], + "env": { + "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/b1d886489eaa8a1cd78be5a02e8007b8/devkittelemetry-linux-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/3eeff69503341ad4323ed465b89294e2/devkittelemetry-linux-musl-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7a7629d7eafaf5a2cdd94030ddf667a7/devkittelemetry-linux-musl-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/d772b9c8e10eccd8ed178872e2338d38/devkittelemetry-linux-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/4714f6220baeedddd128b9fc592c1df6/devkittelemetry-osx-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7b62db776508e8a386fdf6106dac6af7/devkittelemetry-osx-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/cfe334cfe2f27d3b7d3aec2f8c30b258/devkittelemetry-win-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/9b063176e8add94d576242062a3a40ab/devkittelemetry-win-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/32cc73606809486f3901840b48d3ce1a/devkittelemetry-win-x86-7.0.0-preview.23464.2.zip", + "NEW_DEPS_VERSION": "7.0.0-preview.23464.2", + "NEW_DEPS_ID": "RazorTelemetry" + }, + "cwd": "${workspaceFolder}" + }, + { "type": "node", "request": "launch", "name": "Generate debugger options schema", diff --git a/.vscodeignore b/.vscodeignore index e2b1e4b02..71964e020 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -5,6 +5,7 @@ !.omnisharp/** !.razor/** !.razoromnisharp/** +!.razortelemetry/** .rpt2_cache/** .github/** .vscode/** diff --git a/package.json b/package.json index 796faa672..e2d52ce59 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,9 @@ "defaults": { "roslyn": "4.8.0-3.23458.4", "omniSharp": "1.39.7", - "razor": "7.0.0-preview.23456.2", + "razor": "7.0.0-preview.23464.2", "razorOmnisharp": "7.0.0-preview.23363.1", - "razorTelemetry": "test" + "razorTelemetry": "7.0.0-preview.23464.2" }, "main": "./dist/extension", "l10n": "./l10n", @@ -614,7 +614,7 @@ { "id": "Razor", "description": "Razor Language Server (Windows / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/258d3df59cb903ca4bcb9d42b854e28b/razorlanguageserver-win-x64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/fa09591c372229aedafd03203799c783/razorlanguageserver-win-x64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "win32" @@ -622,12 +622,12 @@ "architectures": [ "x86_64" ], - "integrity": "2776B6967DE613C03B2EFEA9490D8B82BDF23E435FE7C6167D6A3ED58EC706ED" + "integrity": "50EAEA0BD01DDC17508571FA2F6ED8C2EAD4574007E85EA83596BCAA5F99DBAB" }, { "id": "Razor", "description": "Razor Language Server (Windows / x86)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d2ffb8978958712807d88ebf38914f47/razorlanguageserver-win-x86-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/ed87299705f127a3dbde56397318860d/razorlanguageserver-win-x86-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "win32" @@ -635,12 +635,12 @@ "architectures": [ "x86" ], - "integrity": "E2040016EF17B2D181BFD5FD8D03FC2959AF8E909ADD17FABFC87370BBA42802" + "integrity": "C2181A523F5B0A5AD3EC3A38662694D30013AB986B4A258F8E8CB982D49B27A8" }, { "id": "Razor", "description": "Razor Language Server (Windows / ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d279c139e3d914fec96dfab50f05f438/razorlanguageserver-win-arm64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/24717a2d1651eb44995e788cad626864/razorlanguageserver-win-arm64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "win32" @@ -648,12 +648,12 @@ "architectures": [ "arm64" ], - "integrity": "FA3FD214F14C61D9E810F36060C09ED7E245697B34371EC705D275BF825E76C4" + "integrity": "4E4543CBD31A5DB7EFF624A2A65D9DC439E2D06B986D9C43359B77020C7AA0BC" }, { "id": "Razor", "description": "Razor Language Server (Linux / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/86a165500517ca828227bfd0f28f7a02/razorlanguageserver-linux-x64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/67c53310d6c7b4e729880fd94ccce9ab/razorlanguageserver-linux-x64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "linux" @@ -664,12 +664,12 @@ "binaries": [ "./rzls" ], - "integrity": "1B5F1A6A74FA0ADA04B7061C243FA4CA72591A1973B992A4C25E94A0137FD3DF" + "integrity": "D1BBDE5455244A9BD3D221ED07C91812B66E9D3DD83CC60D20F1312743C8A25E" }, { "id": "Razor", "description": "Razor Language Server (Linux ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/af4c33cdb53e85a7de39fb07195e05b2/razorlanguageserver-linux-arm64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7a4d697a06da6cb992c591b44fccfb11/razorlanguageserver-linux-arm64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "linux" @@ -680,12 +680,12 @@ "binaries": [ "./rzls" ], - "integrity": "37EC155920952719CD76F7E8BFD65EA3D0A2738A675670B5614D23D9542D5DE8" + "integrity": "07F297AB42A4B4A0F3E6A57A96AB95FCEEA7AB5A07717C635080E747ABF692F8" }, { "id": "Razor", "description": "Razor Language Server (Linux musl / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/e5e12ac99072e02499bef77c2c5034a2/razorlanguageserver-linux-musl-x64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/a8d0a6bc9b1c4e6f1e8ed349e302e9fd/razorlanguageserver-linux-musl-x64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "linux-musl" @@ -696,12 +696,12 @@ "binaries": [ "./rzls" ], - "integrity": "F4399BCEE6192BF3DBA1A6E93DE801075DF1433DF772143B7612FBD60B078361" + "integrity": "951221F4CCCDA06E549CF17B7109D44B3589E9431D36A80B35B92B6AC2AC9E5C" }, { "id": "Razor", "description": "Razor Language Server (Linux musl ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/24783517c9a4729efbd7dfd2a97fe5cc/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/1fa089d63cde8d21ec9ca873b1948bb0/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "linux-musl" @@ -712,12 +712,12 @@ "binaries": [ "./rzls" ], - "integrity": "E471B4F4FB70BB22EB689A759BCAD22B12908EC7446BB98EA69EED974E28E9C7" + "integrity": "0020BBDDBA74B9748083BBD2C09A9FF817A7AFD22B0FF4D69A8B724A50F364BD" }, { "id": "Razor", "description": "Razor Language Server (macOS / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/b9ee27ddd84b0f4faf82e88589c8584f/razorlanguageserver-osx-x64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/cfb24346501d78bc55d0b7521c7e62cb/razorlanguageserver-osx-x64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "darwin" @@ -728,12 +728,12 @@ "binaries": [ "./rzls" ], - "integrity": "B0C40624FE418E3C47DCDC44DDF0643C7F980A254FEEEB49BAED21A010102EB8" + "integrity": "387C3289F842AAFA9865252454A89F5DA8ADCF9EF76A42512ABC24B478E68CFD" }, { "id": "Razor", "description": "Razor Language Server (macOS ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d61e51f223e6bfeceae821b1cce36bfc/razorlanguageserver-osx-arm64-7.0.0-preview.23456.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/a158413d1af07f98d7f753775848978a/razorlanguageserver-osx-arm64-7.0.0-preview.23464.2.zip", "installPath": ".razor", "platforms": [ "darwin" @@ -744,7 +744,7 @@ "binaries": [ "./rzls" ], - "integrity": "C0C325C057E9392845E19F1918F9DEA56500A4188FC619B5529B2785EB2A1D65" + "integrity": "1873CE2BB3FB5BD56D08B91278788FAB2D7D85AF98106A5E844940549589C327" }, { "id": "RazorOmnisharp", @@ -875,15 +875,119 @@ { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Windows / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/03693d2c-3eed-4801-8de8-c71e3ecb3418/e7c8bc1e2881be443f282f19f656ad94/devkittelemetry-win-x64.zip", - "installPath": ".razor/telemetry", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/9b063176e8add94d576242062a3a40ab/devkittelemetry-win-x64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", "platforms": [ "win32" ], "architectures": [ "x86_64" ], - "integrity": "2776B6967DE613C03B2EFEA9490D8B82BDF23E435FE7C6167D6A3ED58EC706ED" + "integrity": "7E16FF4EA6529A41F2A40F73135F48B412E07D7BC9468FD4322BD3CC8450FC26" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Windows / x86)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/32cc73606809486f3901840b48d3ce1a/devkittelemetry-win-x86-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "win32" + ], + "architectures": [ + "x86" + ], + "integrity": "11D9253CB84D8142C386188E78288F26BD7673D86ADF04B66E8AEE03B97C1073" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Windows / ARM64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/cfe334cfe2f27d3b7d3aec2f8c30b258/devkittelemetry-win-arm64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "win32" + ], + "architectures": [ + "arm64" + ], + "integrity": "75D30E266FF242DBA079598A120B0659404FFBE5E0A3C918A4B6E527F2DD34C2" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Linux / x64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/d772b9c8e10eccd8ed178872e2338d38/devkittelemetry-linux-x64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "linux" + ], + "architectures": [ + "x86_64" + ], + "integrity": "5F20542C8E727B64529A5246C482B4A250DADFD4C4156619BD67355838830E81" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Linux ARM64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/b1d886489eaa8a1cd78be5a02e8007b8/devkittelemetry-linux-arm64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "linux" + ], + "architectures": [ + "arm64" + ], + "integrity": "A552C1D7789302BC9D9EFD682417DD6B7B418CC02F6A4A9F47D77977678A0910" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Linux musl / x64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7a7629d7eafaf5a2cdd94030ddf667a7/devkittelemetry-linux-musl-x64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "linux-musl" + ], + "architectures": [ + "x86_64" + ], + "integrity": "32766E5C77FF2D726163EB1105A997829DCF4B549E83F720075C16E9A0949815" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Linux musl ARM64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/3eeff69503341ad4323ed465b89294e2/devkittelemetry-linux-musl-arm64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "linux-musl" + ], + "architectures": [ + "arm64" + ], + "integrity": "7168BFFC13D200F5E374DF470125713A146425572656A350E4591EE8FA5D6D3C" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (macOS / x64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7b62db776508e8a386fdf6106dac6af7/devkittelemetry-osx-x64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "darwin" + ], + "architectures": [ + "x86_64" + ], + "integrity": "8D6DFCAE952503D4250D5EA741ADFF43AE25D1DA74798BB026A382C8835BD8DB" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (macOS ARM64)", + "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/4714f6220baeedddd128b9fc592c1df6/devkittelemetry-osx-arm64-7.0.0-preview.23464.2.zip", + "installPath": ".razortelemetry", + "platforms": [ + "darwin" + ], + "architectures": [ + "arm64" + ], + "integrity": "E3342DAA97A1E36DC20E17CE2F988E38F6371611CF28F2C421B0D3F62301740E" } ], "engines": { diff --git a/src/packageManager/downloadAndInstallPackages.ts b/src/packageManager/downloadAndInstallPackages.ts index 29d612e9d..7a35a0a52 100644 --- a/src/packageManager/downloadAndInstallPackages.ts +++ b/src/packageManager/downloadAndInstallPackages.ts @@ -11,7 +11,7 @@ import { EventStream } from '../eventStream'; import { NetworkSettingsProvider } from '../networkSettings'; import { AbsolutePathPackage } from './absolutePathPackage'; import { touchInstallFile, InstallFileType, deleteInstallFile, installFileExists } from '../common'; -import { InstallationFailure } from '../omnisharp/loggingEvents'; +import { InstallationFailure, IntegrityCheckFailure } from '../omnisharp/loggingEvents'; import { mkdirpSync } from 'fs-extra'; import { PackageInstallStart } from '../omnisharp/loggingEvents'; import { DownloadValidator } from './isValidDownload'; @@ -34,15 +34,15 @@ export async function downloadAndInstallPackages( count = count + 1; installationStage = 'downloadPackage'; const buffer = await DownloadFile(pkg.description, eventStream, provider, pkg.url, pkg.fallbackUrl); - //if (downloadValidator(buffer, pkg.integrity, eventStream)) { - installationStage = 'installPackage'; - await InstallZip(buffer, pkg.description, pkg.installPath, pkg.binaries, eventStream); - installationStage = 'touchLockFile'; - await touchInstallFile(pkg.installPath, InstallFileType.Lock); - break; - //} else { - // eventStream.post(new IntegrityCheckFailure(pkg.description, pkg.url, willTryInstallingPackage())); - //} + if (downloadValidator(buffer, pkg.integrity, eventStream)) { + installationStage = 'installPackage'; + await InstallZip(buffer, pkg.description, pkg.installPath, pkg.binaries, eventStream); + installationStage = 'touchLockFile'; + await touchInstallFile(pkg.installPath, InstallFileType.Lock); + break; + } else { + eventStream.post(new IntegrityCheckFailure(pkg.description, pkg.url, willTryInstallingPackage())); + } } } catch (error) { if (error instanceof NestedError) { diff --git a/src/razor/src/razorLanguageServerClient.ts b/src/razor/src/razorLanguageServerClient.ts index f4c273813..3ed5ffd13 100644 --- a/src/razor/src/razorLanguageServerClient.ts +++ b/src/razor/src/razorLanguageServerClient.ts @@ -256,14 +256,7 @@ export class RazorLanguageServerClient implements vscode.Disposable { args.push('--telemetryLevel', this.vscodeTelemetryReporter.telemetryLevel); args.push('--sessionId', getSessionId()); - args.push( - '--extension', - 'C:/Users/allichou/razor/artifacts/bin/Microsoft.VisualStudio.DevKit.Razor/Debug/net7.0/Microsoft.VisualStudio.DevKit.Razor.dll' - ); - args.push( - '--sharedDependencies', - 'C:/Users/allichou/razor/artifacts/bin/Microsoft.VisualStudio.DevKit.Razor/Debug/net7.0/' - ); + args.push('--extension', '../.razortelemetry/Microsoft.VisualStudio.DevKit.Razor.dll'); } this.serverOptions = { command, args }; diff --git a/src/tools/updatePackageDependencies.ts b/src/tools/updatePackageDependencies.ts index 934c6b438..632fdd16b 100644 --- a/src/tools/updatePackageDependencies.ts +++ b/src/tools/updatePackageDependencies.ts @@ -258,7 +258,7 @@ function getLowercaseFileNameFromUrl(url: string): string { } else if (fileName.startsWith('coreclr-debug')) { // Debugger versions are not contained in the file name. return fileName; - } else if (fileName.startsWith('razorlanguageserver')) { + } else if (fileName.startsWith('razorlanguageserver') || fileName.startsWith('devkittelemetry')) { // Razor versions are everything after the second to last dash. // e.g. we want razorlanguageserver-win-x64 from razorlanguageserver-win-x64-7.0.0-preview.23067.5.zip const secondToLastDash = fileName.lastIndexOf('-', fileName.lastIndexOf('-') - 1); From 463cb459445ab5ec2dfd0cf8c382ce271782e550 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Thu, 14 Sep 2023 17:53:23 -0700 Subject: [PATCH 3/9] Cleanup --- CHANGELOG.md | 2 ++ src/main.ts | 2 ++ src/razor/razor.ts | 2 ++ src/razor/src/extension.ts | 2 ++ src/razor/src/razorLanguageServerClient.ts | 13 ++++++++++--- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 929d222ad..b715ba5d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) ## Latest +* Update Razor version to 7.0.0-preview.23464.2 (PR: ) + * Add Razor language server telemetry when DevKit is installed (PR: ) * Update Razor version to 7.0.0-preview.23456.2 (PR: [#6304](https://github.com/dotnet/vscode-csharp/pull/6304)) * Fixes regression where semantic colors for razor components appear as red * Add support for specifying a .runsettings file when using Roslyn LSP (PR: [#6265](https://github.com/dotnet/vscode-csharp/pull/6265)) diff --git a/src/main.ts b/src/main.ts index e1f1a8480..7acb897c1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -155,6 +155,7 @@ export async function activate( context.extension.extensionPath, eventStream, reporter, + csharpDevkitExtension !== undefined, /* useOmnisharpServer */ false ); @@ -292,6 +293,7 @@ export async function activate( context.extension.extensionPath, eventStream, reporter, + false, /* useOmnisharpServer */ true ); } diff --git a/src/razor/razor.ts b/src/razor/razor.ts index 351ea2441..401b2f40a 100644 --- a/src/razor/razor.ts +++ b/src/razor/razor.ts @@ -16,6 +16,7 @@ export async function activateRazorExtension( extensionPath: string, eventStream: EventStream, vscodeTelemetryReporter: TelemetryReporter, + isCSharpDevKitInstalled: boolean, useOmnisharpServer: boolean ) { const razorConfig = vscode.workspace.getConfiguration('razor'); @@ -43,6 +44,7 @@ export async function activateRazorExtension( languageServerDir, eventStream, vscodeTelemetryReporter, + isCSharpDevKitInstalled, /* enableProposedApis: */ false ); } diff --git a/src/razor/src/extension.ts b/src/razor/src/extension.ts index 0633be429..1e6d432bf 100644 --- a/src/razor/src/extension.ts +++ b/src/razor/src/extension.ts @@ -54,6 +54,7 @@ export async function activate( languageServerDir: string, eventStream: HostEventStream, vscodeTelemetryReporter: TelemetryReporter, + isCSharpDevKitInstalled: boolean, enableProposedApis = false ) { const razorTelemetryReporter = new RazorTelemetryReporter(eventStream); @@ -70,6 +71,7 @@ export async function activate( languageServerDir, razorTelemetryReporter, vscodeTelemetryReporter, + isCSharpDevKitInstalled, logger ); const languageServiceClient = new RazorLanguageServiceClient(languageServerClient); diff --git a/src/razor/src/razorLanguageServerClient.ts b/src/razor/src/razorLanguageServerClient.ts index 3ed5ffd13..16e9c5c6a 100644 --- a/src/razor/src/razorLanguageServerClient.ts +++ b/src/razor/src/razorLanguageServerClient.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { EventEmitter } from 'events'; +import * as util from '../../common'; import * as vscode from 'vscode'; import { RequestHandler, RequestType } from 'vscode-jsonrpc'; import { GenericNotificationHandler, InitializeResult, LanguageClientOptions, State } from 'vscode-languageclient'; @@ -37,6 +38,7 @@ export class RazorLanguageServerClient implements vscode.Disposable { private readonly languageServerDir: string, private readonly razorTelemetryReporter: RazorTelemetryReporter, private readonly vscodeTelemetryReporter: TelemetryReporter, + private readonly isCSharpDevKitInstalled: boolean, private readonly logger: RazorLogger ) { this.isStarted = false; @@ -254,9 +256,14 @@ export class RazorLanguageServerClient implements vscode.Disposable { args.push('--UpdateBuffersForClosedDocuments'); args.push('true'); - args.push('--telemetryLevel', this.vscodeTelemetryReporter.telemetryLevel); - args.push('--sessionId', getSessionId()); - args.push('--extension', '../.razortelemetry/Microsoft.VisualStudio.DevKit.Razor.dll'); + if (this.isCSharpDevKitInstalled) { + args.push('--telemetryLevel', this.vscodeTelemetryReporter.telemetryLevel); + args.push('--sessionId', getSessionId()); + args.push( + '--extension', + util.getExtensionPath() + '\\.razortelemetry\\Microsoft.VisualStudio.DevKit.Razor.dll' + ); + } } this.serverOptions = { command, args }; From 38f2f02641be3e2cfe364660b01f7834972939c1 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Thu, 14 Sep 2023 18:45:42 -0700 Subject: [PATCH 4/9] Update CHANGELOG.md --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b715ba5d9..66dd886e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,9 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) ## Latest -* Update Razor version to 7.0.0-preview.23464.2 (PR: ) - * Add Razor language server telemetry when DevKit is installed (PR: ) -* Update Razor version to 7.0.0-preview.23456.2 (PR: [#6304](https://github.com/dotnet/vscode-csharp/pull/6304)) - * Fixes regression where semantic colors for razor components appear as red +* Update Razor version to 7.0.0-preview.23464.2 (PR: [#9283](https://github.com/dotnet/razor/pull/9283)) + * Add Razor language server telemetry when DevKit is installed (PR: [#6371](https://github.com/dotnet/vscode-csharp/pull/6371)) + * Fixes regression where semantic colors for razor components appear as red (PR: [#6304](https://github.com/dotnet/vscode-csharp/pull/6304)) * Add support for specifying a .runsettings file when using Roslyn LSP (PR: [#6265](https://github.com/dotnet/vscode-csharp/pull/6265)) * Update Roslyn version (PR: [#6265](https://github.com/dotnet/vscode-csharp/pull/6265)) * Add server support for .runsettings in unit tests (PR: [#69792](https://github.com/dotnet/roslyn/pull/69792)) From bece5964b4ebeaff10c0f6e19c3c87e55cea83e9 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Thu, 21 Sep 2023 16:46:37 -0700 Subject: [PATCH 5/9] Refactoring and add env logic --- src/main.ts | 14 +++-- src/razor/razor.ts | 14 +++-- src/razor/src/extension.ts | 69 +++++++++++++++++++++- src/razor/src/razorLanguageServerClient.ts | 39 ++++++++---- src/razor/src/razorLogger.ts | 10 +--- 5 files changed, 115 insertions(+), 31 deletions(-) diff --git a/src/main.ts b/src/main.ts index 7acb897c1..9ffdb32e1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -92,7 +92,7 @@ export async function activate( const razorOptions = optionProvider.GetLatestOptions().razorOptions; requiredPackageIds.push('Razor'); - const csharpDevkitExtension = vscode.extensions.getExtension(csharpDevkitExtensionId); + const csharpDevkitExtension = vscode.extensions.getExtension(csharpDevkitExtensionId); const useOmnisharpServer = !csharpDevkitExtension && optionProvider.GetLatestOptions().commonOptions.useOmnisharpServer; if (useOmnisharpServer) { @@ -124,6 +124,7 @@ export async function activate( const roslynLanguageServerEvents = new RoslynLanguageServerEvents(); context.subscriptions.push(roslynLanguageServerEvents); let roslynLanguageServerStartedPromise: Promise | undefined = undefined; + let razorLanguageServerStartedPromise: Promise | undefined = undefined; let projectInitializationCompletePromise: Promise | undefined = undefined; if (!useOmnisharpServer) { @@ -150,12 +151,14 @@ export async function activate( // Roslyn starts up and registers Razor-specific didOpen/didClose/didChange commands and sends request to Razor // for dynamic file info once project system is ready -> // Razor sends didOpen commands to Roslyn for generated docs and responds to request with dynamic file info - await activateRazorExtension( + razorLanguageServerStartedPromise = activateRazorExtension( context, context.extension.extensionPath, eventStream, reporter, - csharpDevkitExtension !== undefined, + csharpDevkitExtension, + optionProvider, + platformInfo, /* useOmnisharpServer */ false ); @@ -293,7 +296,9 @@ export async function activate( context.extension.extensionPath, eventStream, reporter, - false, + undefined, + optionProvider, + platformInfo, /* useOmnisharpServer */ true ); } @@ -351,6 +356,7 @@ export async function activate( return { initializationFinished: async () => { await coreClrDebugPromise; + await razorLanguageServerStartedPromise; await roslynLanguageServerStartedPromise; await projectInitializationCompletePromise; }, diff --git a/src/razor/razor.ts b/src/razor/razor.ts index 401b2f40a..952cdadfb 100644 --- a/src/razor/razor.ts +++ b/src/razor/razor.ts @@ -10,13 +10,17 @@ import * as vscode from 'vscode'; import * as Razor from '../../src/razor/src/extension'; import { EventStream } from '../eventStream'; import TelemetryReporter from '@vscode/extension-telemetry'; +import OptionProvider from '../shared/observers/optionProvider'; +import { PlatformInformation } from '../shared/platform'; export async function activateRazorExtension( context: vscode.ExtensionContext, extensionPath: string, eventStream: EventStream, vscodeTelemetryReporter: TelemetryReporter, - isCSharpDevKitInstalled: boolean, + csharpDevkitExtension: vscode.Extension | undefined, + optionProvider: OptionProvider, + platformInfo: PlatformInformation, useOmnisharpServer: boolean ) { const razorConfig = vscode.workspace.getConfiguration('razor'); @@ -30,7 +34,7 @@ export async function activateRazorExtension( if (fs.existsSync(languageServerDir)) { if (useOmnisharpServer) { - await RazorOmniSharp.activate( + return await RazorOmniSharp.activate( vscode, context, languageServerDir, @@ -38,13 +42,15 @@ export async function activateRazorExtension( /* enableProposedApis: */ false ); } else { - await Razor.activate( + return await Razor.activate( vscode, context, languageServerDir, eventStream, vscodeTelemetryReporter, - isCSharpDevKitInstalled, + csharpDevkitExtension, + optionProvider, + platformInfo, /* enableProposedApis: */ false ); } diff --git a/src/razor/src/extension.ts b/src/razor/src/extension.ts index 1e6d432bf..82957d288 100644 --- a/src/razor/src/extension.ts +++ b/src/razor/src/extension.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as path from 'path'; import * as vscode from 'vscode'; import * as vscodeapi from 'vscode'; import { ExtensionContext } from 'vscode'; @@ -45,6 +46,12 @@ import { TelemetryReporter as RazorTelemetryReporter } from './telemetryReporter import { RazorDiagnosticHandler } from './diagnostics/razorDiagnosticHandler'; import { RazorSimplifyMethodHandler } from './simplify/razorSimplifyMethodHandler'; import TelemetryReporter from '@vscode/extension-telemetry'; +import { CSharpDevKitExports } from '../../csharpDevKitExports'; +import OptionProvider from '../../shared/observers/optionProvider'; +import { DotnetRuntimeExtensionResolver } from '../../lsptoolshost/dotnetRuntimeExtensionResolver'; +import { PlatformInformation } from '../../shared/platform'; +import { RazorLanguageServerOptions } from './razorLanguageServerOptions'; +import { resolveRazorLanguageServerOptions } from './razorLanguageServerOptionsResolver'; // We specifically need to take a reference to a particular instance of the vscode namespace, // otherwise providers attempt to operate on the null extension. @@ -54,7 +61,9 @@ export async function activate( languageServerDir: string, eventStream: HostEventStream, vscodeTelemetryReporter: TelemetryReporter, - isCSharpDevKitInstalled: boolean, + csharpDevkitExtension: vscode.Extension | undefined, + optionProvider: OptionProvider, + platformInfo: PlatformInformation, enableProposedApis = false ) { const razorTelemetryReporter = new RazorTelemetryReporter(eventStream); @@ -63,17 +72,51 @@ export async function activate( }; const languageServerTrace = resolveRazorLanguageServerTrace(vscodeType); - const logger = new RazorLogger(vscodeType, eventEmitterFactory, languageServerTrace); + const logger = new RazorLogger(eventEmitterFactory, languageServerTrace); try { + const razorOptions: RazorLanguageServerOptions = resolveRazorLanguageServerOptions( + vscodeType, + languageServerDir, + languageServerTrace, + logger + ); + + const hostExecutableResolver = new DotnetRuntimeExtensionResolver( + platformInfo, + () => razorOptions.serverPath, + logger.outputChannel, + context.extensionPath + ); + + const options = optionProvider.GetLatestOptions(); + const dotnetInfo = await hostExecutableResolver.getHostExecutableInfo(options); + const dotnetRuntimePath = path.dirname(dotnetInfo.path); + + // Take care to always run .NET processes on the runtime that we intend. + // The dotnet.exe we point to should not go looking for other runtimes. + const env: NodeJS.ProcessEnv = { ...process.env }; + env.DOTNET_ROOT = dotnetRuntimePath; + env.DOTNET_MULTILEVEL_LOOKUP = '0'; + // Save user's DOTNET_ROOT env-var value so server can recover the user setting when needed + env.DOTNET_ROOT_USER = process.env.DOTNET_ROOT ?? 'EMPTY'; + + // Set up DevKit environment for telemetry + if (csharpDevkitExtension) { + await setupDevKitEnvironment(env, csharpDevkitExtension, logger); + } + const languageServerClient = new RazorLanguageServerClient( vscodeType, languageServerDir, razorTelemetryReporter, vscodeTelemetryReporter, - isCSharpDevKitInstalled, + csharpDevkitExtension !== undefined, + env, + dotnetInfo.path, logger ); + const languageServiceClient = new RazorLanguageServiceClient(languageServerClient); const documentManager = new RazorDocumentManager(languageServerClient, logger); @@ -289,3 +332,23 @@ async function startLanguageServer( await languageServerClient.start(); } } + +async function setupDevKitEnvironment( + env: NodeJS.ProcessEnv, + csharpDevkitExtension: vscode.Extension, + logger: RazorLogger +): Promise { + try { + const exports = 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 (!(await exports).setupTelemetryEnvironmentAsync) { + return; + } + + (await exports).setupTelemetryEnvironmentAsync(env); + } catch (error) { + logger.logError('Failed to setup DevKit environment for telemetry.', error as Error); + } +} diff --git a/src/razor/src/razorLanguageServerClient.ts b/src/razor/src/razorLanguageServerClient.ts index 16e9c5c6a..0cb2d1eb6 100644 --- a/src/razor/src/razorLanguageServerClient.ts +++ b/src/razor/src/razorLanguageServerClient.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as cp from 'child_process'; import { EventEmitter } from 'events'; import * as util from '../../common'; import * as vscode from 'vscode'; @@ -39,6 +40,8 @@ export class RazorLanguageServerClient implements vscode.Disposable { private readonly razorTelemetryReporter: RazorTelemetryReporter, private readonly vscodeTelemetryReporter: TelemetryReporter, private readonly isCSharpDevKitInstalled: boolean, + private readonly env: NodeJS.ProcessEnv, + private readonly dotnetExecutablePath: string, private readonly logger: RazorLogger ) { this.isStarted = false; @@ -216,23 +219,12 @@ export class RazorLanguageServerClient implements vscode.Disposable { languageServerTrace, this.logger ); - this.clientOptions = { outputChannel: options.outputChannel, documentSelector: [{ language: RazorLanguage.id, pattern: RazorLanguage.globbingPattern }], }; const args: string[] = []; - let command = options.serverPath; - if (options.serverPath.endsWith('.dll')) { - this.logger.logMessage( - 'Razor Language Server path is an assembly. ' + - "Using 'dotnet' from the current path to start the server." - ); - - command = 'dotnet'; - args.push(options.serverPath); - } this.logger.logMessage(`Razor language server path: ${options.serverPath}`); @@ -260,13 +252,34 @@ export class RazorLanguageServerClient implements vscode.Disposable { args.push('--telemetryLevel', this.vscodeTelemetryReporter.telemetryLevel); args.push('--sessionId', getSessionId()); args.push( - '--extension', + '--telemetryExtensionPath', util.getExtensionPath() + '\\.razortelemetry\\Microsoft.VisualStudio.DevKit.Razor.dll' ); } } - this.serverOptions = { command, args }; + let childProcess: () => Promise; + const cpOptions: cp.SpawnOptionsWithoutStdio = { + detached: true, + windowsHide: true, + env: this.env, + }; + + if (options.serverPath.endsWith('.dll')) { + // If we were given a path to a dll, launch that via dotnet. + const argsWithPath = [options.serverPath].concat(args); + this.logger.logMessage(`Server arguments ${argsWithPath.join(' ')}`); + + childProcess = async () => cp.spawn(this.dotnetExecutablePath, argsWithPath, cpOptions); + } else { + // Otherwise assume we were given a path to an executable. + this.logger.logMessage(`Server arguments ${args.join(' ')}`); + + childProcess = async () => cp.spawn(options.serverPath, args, cpOptions); + } + + this.serverOptions = childProcess; + this.client = new LanguageClient( 'razorLanguageServer', 'Razor Language Server', diff --git a/src/razor/src/razorLogger.ts b/src/razor/src/razorLogger.ts index 8a2e5625a..970626783 100644 --- a/src/razor/src/razorLogger.ts +++ b/src/razor/src/razorLogger.ts @@ -15,21 +15,17 @@ export class RazorLogger implements vscodeAdapter.Disposable { public static readonly verbositySetting = 'razor.trace'; public verboseEnabled!: boolean; public messageEnabled!: boolean; - public readonly outputChannel: vscodeAdapter.OutputChannel; + public readonly outputChannel: vscode.OutputChannel; private readonly onLogEmitter: vscodeAdapter.EventEmitter; private readonly onTraceLevelChangeEmitter: vscodeAdapter.EventEmitter; - constructor( - private readonly vscodeApi: vscodeAdapter.api, - eventEmitterFactory: IEventEmitterFactory, - public trace: Trace - ) { + constructor(eventEmitterFactory: IEventEmitterFactory, public trace: Trace) { this.processTraceLevel(); this.onLogEmitter = eventEmitterFactory.create(); this.onTraceLevelChangeEmitter = eventEmitterFactory.create(); - this.outputChannel = this.vscodeApi.window.createOutputChannel(RazorLogger.logName); + this.outputChannel = vscode.window.createOutputChannel(RazorLogger.logName); this.logRazorInformation(); this.setupToStringOverrides(); From 070ac1f646c22be6e48d7dcfffdf8b6e027ae9e5 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Thu, 21 Sep 2023 16:49:14 -0700 Subject: [PATCH 6/9] Cleanup --- src/razor/razor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/razor/razor.ts b/src/razor/razor.ts index 952cdadfb..d3cf16e73 100644 --- a/src/razor/razor.ts +++ b/src/razor/razor.ts @@ -34,7 +34,7 @@ export async function activateRazorExtension( if (fs.existsSync(languageServerDir)) { if (useOmnisharpServer) { - return await RazorOmniSharp.activate( + await RazorOmniSharp.activate( vscode, context, languageServerDir, @@ -42,7 +42,7 @@ export async function activateRazorExtension( /* enableProposedApis: */ false ); } else { - return await Razor.activate( + await Razor.activate( vscode, context, languageServerDir, From 4e1513bc87f20f0ed1a9f56ecfdb89484674cba6 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Fri, 22 Sep 2023 02:37:02 -0700 Subject: [PATCH 7/9] Add await to fix bug --- src/razor/src/extension.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/razor/src/extension.ts b/src/razor/src/extension.ts index 82957d288..0d7d34d03 100644 --- a/src/razor/src/extension.ts +++ b/src/razor/src/extension.ts @@ -339,15 +339,15 @@ async function setupDevKitEnvironment( logger: RazorLogger ): Promise { try { - const exports = csharpDevkitExtension.activate(); + const exports = 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 (!(await exports).setupTelemetryEnvironmentAsync) { + if (!exports.setupTelemetryEnvironmentAsync) { return; } - (await exports).setupTelemetryEnvironmentAsync(env); + await exports.setupTelemetryEnvironmentAsync(env); } catch (error) { logger.logError('Failed to setup DevKit environment for telemetry.', error as Error); } From 43b9c584681b1e8c62bf889d2a05583a2343a87b Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Fri, 22 Sep 2023 23:06:53 -0700 Subject: [PATCH 8/9] Update to actual Razor package versions --- .vscode/launch.json | 8 ++--- package.json | 74 ++++++++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f401a8d83..194789128 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -290,8 +290,8 @@ "updatePackageDependencies" ], "env": { - "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/5d2a9551b2419050af29fd67cbfb07e2/razorlanguageserver-linux-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/c9d05d0efed3e5eef277fca1a8b6a9ed/razorlanguageserver-linux-musl-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/4e41816de1d92aaa60902ac6cdbd2b32/razorlanguageserver-linux-musl-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/220b7d238a8e4b5de28dfd1b8dc1b828/razorlanguageserver-linux-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/3189d3c39a5064da2695e522f1b0e82a/razorlanguageserver-osx-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/9c8b944036c4a878f06c27dff6754699/razorlanguageserver-osx-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/2325f8e4f971ce802a3cc9c6b4491e05/razorlanguageserver-win-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/6367c634fe3d849456d2ff67b572ec1a/razorlanguageserver-win-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/2d57ef6a6a45f5eb743298fd8d488990/razorlanguageserver-win-x86-8.0.0-preview.23465.2.zip", - "NEW_DEPS_VERSION": "8.0.0-preview.23465.2", + "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/1f7ca88955dd8ee28a016c7b699de1a8/razorlanguageserver-linux-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/e2b17d54dfea4ce7a1ebc3e20f93e006/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/1a9c9111b37d3254d1c6edbdb62fa382/razorlanguageserver-linux-musl-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/8df1db725708594806369c7e8a547a02/razorlanguageserver-linux-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/f6cfc265a4e01a4bc6e493abdeab3e4c/razorlanguageserver-osx-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/34134fce2a63158bcf5b7e8c3813289a/razorlanguageserver-osx-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/4534001b203012f51e0bd897c16dd414/razorlanguageserver-win-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/0156660d3533efef9a0563a6c95686d9/razorlanguageserver-win-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/43aae1d74406b86393bd98af202e4b73/razorlanguageserver-win-x86-7.0.0-preview.23472.3.zip", + "NEW_DEPS_VERSION": "7.0.0-preview.23472.3", "NEW_DEPS_ID": "Razor" }, "cwd": "${workspaceFolder}" @@ -306,8 +306,8 @@ "updatePackageDependencies" ], "env": { - "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/b1d886489eaa8a1cd78be5a02e8007b8/devkittelemetry-linux-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/3eeff69503341ad4323ed465b89294e2/devkittelemetry-linux-musl-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7a7629d7eafaf5a2cdd94030ddf667a7/devkittelemetry-linux-musl-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/d772b9c8e10eccd8ed178872e2338d38/devkittelemetry-linux-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/4714f6220baeedddd128b9fc592c1df6/devkittelemetry-osx-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7b62db776508e8a386fdf6106dac6af7/devkittelemetry-osx-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/cfe334cfe2f27d3b7d3aec2f8c30b258/devkittelemetry-win-arm64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/9b063176e8add94d576242062a3a40ab/devkittelemetry-win-x64-7.0.0-preview.23464.2.zip,https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/32cc73606809486f3901840b48d3ce1a/devkittelemetry-win-x86-7.0.0-preview.23464.2.zip", - "NEW_DEPS_VERSION": "7.0.0-preview.23464.2", + "NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/008191bf243e1dd102a0627e3242fc66/devkittelemetry-linux-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/a347264ccae9c38677e359659f6124ad/devkittelemetry-linux-musl-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/5309c20ceb995ef7649d07e8814a9f75/devkittelemetry-linux-musl-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/faf87c17729b1677c822d5a6ef3e39c7/devkittelemetry-linux-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/3297feafe2e604742f5c5d8864444941/devkittelemetry-osx-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/f74c5297dbe0a96ab3a43def2dda1a63/devkittelemetry-osx-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/092f8e423a04948ae2c66678e948c7ad/devkittelemetry-win-arm64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/f47ecd4e96606355e87804b1c21e4c69/devkittelemetry-win-x64-7.0.0-preview.23472.3.zip,https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/87a29ddab008eb63b49e115525873c84/devkittelemetry-win-x86-7.0.0-preview.23472.3.zip", + "NEW_DEPS_VERSION": "7.0.0-preview.23472.3", "NEW_DEPS_ID": "RazorTelemetry" }, "cwd": "${workspaceFolder}" diff --git a/package.json b/package.json index ca4749252..741443b2f 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "defaults": { "roslyn": "4.8.0-3.23472.2", "omniSharp": "1.39.7", - "razor": "8.0.0-preview.23465.2", + "razor": "7.0.0-preview.23472.3", "razorOmnisharp": "7.0.0-preview.23363.1" }, "main": "./dist/extension", @@ -612,7 +612,7 @@ { "id": "Razor", "description": "Razor Language Server (Windows / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/6367c634fe3d849456d2ff67b572ec1a/razorlanguageserver-win-x64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/0156660d3533efef9a0563a6c95686d9/razorlanguageserver-win-x64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "win32" @@ -620,12 +620,12 @@ "architectures": [ "x86_64" ], - "integrity": "654766096AA68FD4E0752799F9E2C1829EF9E97FBCCE4E4ABF33A4D0405C2239" + "integrity": "A759DB901BFA29FD37B58101B32B8425D6495E7A62D031E5ECBBB4756E69A477" }, { "id": "Razor", "description": "Razor Language Server (Windows / x86)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/2d57ef6a6a45f5eb743298fd8d488990/razorlanguageserver-win-x86-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/43aae1d74406b86393bd98af202e4b73/razorlanguageserver-win-x86-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "win32" @@ -633,12 +633,12 @@ "architectures": [ "x86" ], - "integrity": "08EBD8C15E705A2B95CD263ACC4DE0719408AFCA8D3BF96367A937B267870777" + "integrity": "D1925AE25EA83BD2CDBF0B32625499B1AFC650860641CA7CD69243F4C1C05987" }, { "id": "Razor", "description": "Razor Language Server (Windows / ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/2325f8e4f971ce802a3cc9c6b4491e05/razorlanguageserver-win-arm64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/4534001b203012f51e0bd897c16dd414/razorlanguageserver-win-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "win32" @@ -646,12 +646,12 @@ "architectures": [ "arm64" ], - "integrity": "5BBB95BC609E2F05FE2E51B513FAAC70CAD2B5CA4C31D498906DCF60E9529621" + "integrity": "E14234FEBCD62839DB3A10F97949D3C9D67066817951E365ACFA2A47F25DD6FB" }, { "id": "Razor", "description": "Razor Language Server (Linux / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/220b7d238a8e4b5de28dfd1b8dc1b828/razorlanguageserver-linux-x64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/8df1db725708594806369c7e8a547a02/razorlanguageserver-linux-x64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "linux" @@ -662,12 +662,12 @@ "binaries": [ "./rzls" ], - "integrity": "B5C84C50CE8973B70EBEA6D547B1E9F021A0A1920B539BD608CE701149F0AE5C" + "integrity": "9751E8EBB8C9E081A77CC244620C41F1F2F1E21EB32FF3B39A53FF1DE6E7F584" }, { "id": "Razor", "description": "Razor Language Server (Linux ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/5d2a9551b2419050af29fd67cbfb07e2/razorlanguageserver-linux-arm64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/1f7ca88955dd8ee28a016c7b699de1a8/razorlanguageserver-linux-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "linux" @@ -678,12 +678,12 @@ "binaries": [ "./rzls" ], - "integrity": "5CD8BA307DC9D68DD6ABE0EC462A8CBFB579CD4949486AB070E4AC9AEA89F304" + "integrity": "BDD38577C2CB58331C22EF026F055DF8EC07D54F5DFF0459ACE6898A79196FFE" }, { "id": "Razor", "description": "Razor Language Server (Linux musl / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/4e41816de1d92aaa60902ac6cdbd2b32/razorlanguageserver-linux-musl-x64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/1a9c9111b37d3254d1c6edbdb62fa382/razorlanguageserver-linux-musl-x64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "linux-musl" @@ -694,12 +694,12 @@ "binaries": [ "./rzls" ], - "integrity": "EA045D0202FCF69A74E8A45463023D9F8CD82113ED5794EF69D708CD68345776" + "integrity": "ACC724F50297F60CEC28145BB0ED5DCC85FE335BFC04BB80ACF6F317C2FAB946" }, { "id": "Razor", "description": "Razor Language Server (Linux musl ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/c9d05d0efed3e5eef277fca1a8b6a9ed/razorlanguageserver-linux-musl-arm64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/e2b17d54dfea4ce7a1ebc3e20f93e006/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "linux-musl" @@ -710,12 +710,12 @@ "binaries": [ "./rzls" ], - "integrity": "CDD3717BB6EA5C42A4A5E46E3AEEC5E74F04272565E711D40A36464A0EC2882F" + "integrity": "BF700EDD2F855E43712952E230FC6B6E1BFB63002E062B548E5E58883129103A" }, { "id": "Razor", "description": "Razor Language Server (macOS / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/9c8b944036c4a878f06c27dff6754699/razorlanguageserver-osx-x64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/34134fce2a63158bcf5b7e8c3813289a/razorlanguageserver-osx-x64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "darwin" @@ -726,12 +726,12 @@ "binaries": [ "./rzls" ], - "integrity": "3BA5A019885CC638E99E980BAFC5FE7CD29A52CA81F165529911ABDD66EE9EEE" + "integrity": "FC02FD4D1D9EE5DB18725F467FD683D5860C36D06A0F400628477F6E87B8740D" }, { "id": "Razor", "description": "Razor Language Server (macOS ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/3189d3c39a5064da2695e522f1b0e82a/razorlanguageserver-osx-arm64-8.0.0-preview.23465.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/f6cfc265a4e01a4bc6e493abdeab3e4c/razorlanguageserver-osx-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razor", "platforms": [ "darwin" @@ -742,7 +742,7 @@ "binaries": [ "./rzls" ], - "integrity": "5473557F95688C31029E9CAA30EFD1651F935F0079F84E1044FD523D60604E7A" + "integrity": "30EE0106E46CFBAB92110BE07913DE6D26FD554BAC3D4C24D7DE920688843080" }, { "id": "RazorOmnisharp", @@ -873,7 +873,7 @@ { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Windows / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/9b063176e8add94d576242062a3a40ab/devkittelemetry-win-x64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/f47ecd4e96606355e87804b1c21e4c69/devkittelemetry-win-x64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "win32" @@ -881,12 +881,12 @@ "architectures": [ "x86_64" ], - "integrity": "7E16FF4EA6529A41F2A40F73135F48B412E07D7BC9468FD4322BD3CC8450FC26" + "integrity": "B7698EF8B714CCD63B19A352D50A7945A504746783EA0651826F16BFD6A9DAC3" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Windows / x86)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/32cc73606809486f3901840b48d3ce1a/devkittelemetry-win-x86-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/87a29ddab008eb63b49e115525873c84/devkittelemetry-win-x86-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "win32" @@ -894,12 +894,12 @@ "architectures": [ "x86" ], - "integrity": "11D9253CB84D8142C386188E78288F26BD7673D86ADF04B66E8AEE03B97C1073" + "integrity": "A9C5853CF54923C1E6F3671B6F3EF7C5AF6215E65A1CDD04586227B48AEE1CC3" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Windows / ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/cfe334cfe2f27d3b7d3aec2f8c30b258/devkittelemetry-win-arm64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/092f8e423a04948ae2c66678e948c7ad/devkittelemetry-win-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "win32" @@ -907,12 +907,12 @@ "architectures": [ "arm64" ], - "integrity": "75D30E266FF242DBA079598A120B0659404FFBE5E0A3C918A4B6E527F2DD34C2" + "integrity": "21A2581FAEBBEEF7D86D5289109151886A07102160FDC8B3FD1EA0EE2E06F8D2" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Linux / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/d772b9c8e10eccd8ed178872e2338d38/devkittelemetry-linux-x64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/faf87c17729b1677c822d5a6ef3e39c7/devkittelemetry-linux-x64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "linux" @@ -920,12 +920,12 @@ "architectures": [ "x86_64" ], - "integrity": "5F20542C8E727B64529A5246C482B4A250DADFD4C4156619BD67355838830E81" + "integrity": "26053C9E43A16AFA2B467DE3C221C8EE50A3DD2CC99A3171192A9DB77C273504" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Linux ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/b1d886489eaa8a1cd78be5a02e8007b8/devkittelemetry-linux-arm64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/008191bf243e1dd102a0627e3242fc66/devkittelemetry-linux-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "linux" @@ -933,12 +933,12 @@ "architectures": [ "arm64" ], - "integrity": "A552C1D7789302BC9D9EFD682417DD6B7B418CC02F6A4A9F47D77977678A0910" + "integrity": "EBCB3FA36B3E88CD04FCBB5AE992E216FB46F1B146B2BA6E9F3C6ED9A7D42F7A" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Linux musl / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7a7629d7eafaf5a2cdd94030ddf667a7/devkittelemetry-linux-musl-x64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/5309c20ceb995ef7649d07e8814a9f75/devkittelemetry-linux-musl-x64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "linux-musl" @@ -946,12 +946,12 @@ "architectures": [ "x86_64" ], - "integrity": "32766E5C77FF2D726163EB1105A997829DCF4B549E83F720075C16E9A0949815" + "integrity": "65D601A59B7C53CF7A4F7990B66DCE8AEE3833C70424CFCF8B6C0D7795ACB1B1" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (Linux musl ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/3eeff69503341ad4323ed465b89294e2/devkittelemetry-linux-musl-arm64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/a347264ccae9c38677e359659f6124ad/devkittelemetry-linux-musl-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "linux-musl" @@ -959,12 +959,12 @@ "architectures": [ "arm64" ], - "integrity": "7168BFFC13D200F5E374DF470125713A146425572656A350E4591EE8FA5D6D3C" + "integrity": "D358D723892C97AE9AEDF1882A7F33B6F162A10F6211A18ED8817F7B164ED4D3" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (macOS / x64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/7b62db776508e8a386fdf6106dac6af7/devkittelemetry-osx-x64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/f74c5297dbe0a96ab3a43def2dda1a63/devkittelemetry-osx-x64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "darwin" @@ -972,12 +972,12 @@ "architectures": [ "x86_64" ], - "integrity": "8D6DFCAE952503D4250D5EA741ADFF43AE25D1DA74798BB026A382C8835BD8DB" + "integrity": "959F396E8C8D18A509831DAD8F5650352BB66EF9B317A670D3D7C81F7B601431" }, { "id": "RazorTelemetry", "description": "Razor Language Server Telemetry (macOS ARM64)", - "url": "https://download.visualstudio.microsoft.com/download/pr/d65d9f27-9718-4708-888e-caf62d6f0b72/4714f6220baeedddd128b9fc592c1df6/devkittelemetry-osx-arm64-7.0.0-preview.23464.2.zip", + "url": "https://download.visualstudio.microsoft.com/download/pr/e0c516ea-aa15-448e-8fee-a2f27785ee9e/3297feafe2e604742f5c5d8864444941/devkittelemetry-osx-arm64-7.0.0-preview.23472.3.zip", "installPath": ".razortelemetry", "platforms": [ "darwin" @@ -985,7 +985,7 @@ "architectures": [ "arm64" ], - "integrity": "E3342DAA97A1E36DC20E17CE2F988E38F6371611CF28F2C421B0D3F62301740E" + "integrity": "241B712A67C107AF1D8AB15973D845B071C6D6DAF0CB93B09356E9598A597ECE" } ], "engines": { From ce997753f1389920a6ec4a6c995811f198b83f37 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Fri, 22 Sep 2023 23:10:26 -0700 Subject: [PATCH 9/9] Change variable name to be clearer --- src/razor/src/razorLanguageServerClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/razor/src/razorLanguageServerClient.ts b/src/razor/src/razorLanguageServerClient.ts index 0cb2d1eb6..b9a7437f0 100644 --- a/src/razor/src/razorLanguageServerClient.ts +++ b/src/razor/src/razorLanguageServerClient.ts @@ -39,7 +39,7 @@ export class RazorLanguageServerClient implements vscode.Disposable { private readonly languageServerDir: string, private readonly razorTelemetryReporter: RazorTelemetryReporter, private readonly vscodeTelemetryReporter: TelemetryReporter, - private readonly isCSharpDevKitInstalled: boolean, + private readonly isCSharpDevKitActivated: boolean, private readonly env: NodeJS.ProcessEnv, private readonly dotnetExecutablePath: string, private readonly logger: RazorLogger @@ -248,7 +248,7 @@ export class RazorLanguageServerClient implements vscode.Disposable { args.push('--UpdateBuffersForClosedDocuments'); args.push('true'); - if (this.isCSharpDevKitInstalled) { + if (this.isCSharpDevKitActivated) { args.push('--telemetryLevel', this.vscodeTelemetryReporter.telemetryLevel); args.push('--sessionId', getSessionId()); args.push(