Skip to content

Commit

Permalink
[Razor] Support platform agnostic language server & telemetry (#6600)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonchou authored Oct 27, 2023
1 parent 1a8a3a9 commit d27b1bc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -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": {
Expand Down
11 changes: 10 additions & 1 deletion src/razor/razorTelemetryDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ export class RazorTelemetryDownloader {
public async DownloadAndInstallRazorTelemetry(version: string): Promise<boolean> {
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));
Expand Down
5 changes: 5 additions & 0 deletions tasks/offlinePackagingTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d27b1bc

Please sign in to comment.