From d27b1bce36be79a4ba370d4a2f8734c674a35a2e Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Fri, 27 Oct 2023 15:35:13 -0700 Subject: [PATCH] [Razor] Support platform agnostic language server & telemetry (#6600) --- package.json | 29 +++++++++++++++++++++++++++ src/razor/razorTelemetryDownloader.ts | 11 +++++++++- tasks/offlinePackagingTasks.ts | 5 +++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 303cb246d..b34eaae4a 100644 --- a/package.json +++ b/package.json @@ -732,6 +732,22 @@ ], "integrity": "AB4D44465EA5135912737F8D943DB8DB7ADF1CC213F433188401FEE36B78A319" }, + { + "id": "Razor", + "description": "Razor Language Server (Platform Agnostic)", + "url": "https://download.visualstudio.microsoft.com/download/pr/f8b5b74b-3df3-47cc-83b1-cd1d93d1771d/e456a753103b84b87bf5f000499ce3d7/razorlanguageserver-platformagnostic-7.0.0-preview.23513.5.zip", + "installPath": ".razor", + "platforms": [ + "neutral" + ], + "architectures": [ + "neutral" + ], + "binaries": [ + "./rzls" + ], + "integrity": "0CDC371C58614CBD5BAE83A0AEDF9896115A637E3AF007B7E399F5414CA66451" + }, { "id": "RazorOmnisharp", "description": "Razor Language Server for OmniSharp (Windows / x64)", @@ -974,6 +990,19 @@ "arm64" ], "integrity": "65B17BBB7BA66987F74ED0B9261FC495BBB40C8C1C4FC4F8981BA5824B300A00" + }, + { + "id": "RazorTelemetry", + "description": "Razor Language Server Telemetry (Platform Agnostic)", + "url": "https://download.visualstudio.microsoft.com/download/pr/f8b5b74b-3df3-47cc-83b1-cd1d93d1771d/1affdce6b3431a5ed16d545a325a8474/devkittelemetry-platformagnostic-7.0.0-preview.23513.5.zip", + "installPath": ".razortelemetry", + "platforms": [ + "netural" + ], + "architectures": [ + "neutral" + ], + "integrity": "5410885094C69A494D847755CC974F41850AC21C613D140B4A775DE7E531880E" } ], "engines": { diff --git a/src/razor/razorTelemetryDownloader.ts b/src/razor/razorTelemetryDownloader.ts index c3ad95e7c..4a434ddcc 100644 --- a/src/razor/razorTelemetryDownloader.ts +++ b/src/razor/razorTelemetryDownloader.ts @@ -24,12 +24,21 @@ export class RazorTelemetryDownloader { public async DownloadAndInstallRazorTelemetry(version: string): Promise { const runtimeDependencies = getRuntimeDependenciesPackages(this.packageJSON); const razorPackages = runtimeDependencies.filter((inputPackage) => inputPackage.id === 'RazorTelemetry'); - const packagesToInstall = await getAbsolutePathPackagesToInstall( + let packagesToInstall = await getAbsolutePathPackagesToInstall( razorPackages, this.platformInfo, this.extensionPath ); + if (packagesToInstall.length == 0) { + const platformNeutral = new PlatformInformation('neutral', 'neutral'); + packagesToInstall = await getAbsolutePathPackagesToInstall( + razorPackages, + platformNeutral, + this.extensionPath + ); + } + if (packagesToInstall.length > 0) { this.eventStream.post(new PackageInstallation(`Razor Telemetry Version = ${version}`)); this.eventStream.post(new LogPlatformInfo(this.platformInfo)); diff --git a/tasks/offlinePackagingTasks.ts b/tasks/offlinePackagingTasks.ts index 74c71abba..420f73de5 100644 --- a/tasks/offlinePackagingTasks.ts +++ b/tasks/offlinePackagingTasks.ts @@ -138,6 +138,11 @@ async function acquireRoslyn( } async function installRazor(packageJSON: any, platformInfo: PlatformInformation) { + if (platformInfo === undefined) { + const platformNeutral = new PlatformInformation('neutral', 'neutral'); + return await installPackageJsonDependency('Razor', packageJSON, platformNeutral); + } + return await installPackageJsonDependency('Razor', packageJSON, platformInfo); }