Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Razor] Support platform agnostic language server & telemetry #6600

Merged

Conversation

allisonchou
Copy link
Contributor

Supports platform agnostic language server + telemetry for Razor in the case that the user isn't using an officially supported platform and architecture.

@allisonchou allisonchou requested review from a team as code owners October 26, 2023 20:29
{
"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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version doesn't exactly match the version above since 23516.2 wasn't published with a platform agnostic language server. This is temporary and should be resolved whenever Razor next updates its versions.

Copy link
Member

@davidwengier davidwengier Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as soon as dotnet/roslyn#70568 merges we can bump razor and roslyn, in this PR perhaps?

return await installPackageJsonDependency('Razor', packageJSON, platformInfo);
if (!(await installPackageJsonDependency('Razor', packageJSON, platformInfo))) {
// Try downloading platform neutral package instead
const platformNeutral = new PlatformInformation('neutral', 'neutral');
Copy link
Member

@dibarbet dibarbet Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should have this fallback. If the platform doesn't exist that we're packaging the vsix for, that is an error in setup authoring.

Fine with having fallbacks at runtime. But not in creating the vsix. Otherwise we might randomly get official platform specific vsix's that have a platform neutral razor server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair - I updated the code to not fallback in this method

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So when is platformInfo undefined here? When someone does a build and pack on a machine architecture we don't officially support? Or are we going to start producing platform agnostic builds of the whole extension?

Copy link
Contributor Author

@allisonchou allisonchou Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think eventually once we do start publishing our language agnostic servers to the marketplace, this method would be changed to return undefined instead of throwing:

public static async GetCurrent(): Promise<PlatformInformation> {

I made the condition undefined based on a similar Roslyn condition:

if (platformInfo === undefined) {

@allisonchou allisonchou requested a review from dibarbet October 27, 2023 00:34
Copy link
Member

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving because the code looks good, but we don't want to merge this, right, because the versions are wrong? Or maybe it doens't matter because not many people are going to actually be trying to pull the platform agnostic builds?

return await installPackageJsonDependency('Razor', packageJSON, platformInfo);
if (!(await installPackageJsonDependency('Razor', packageJSON, platformInfo))) {
// Try downloading platform neutral package instead
const platformNeutral = new PlatformInformation('neutral', 'neutral');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So when is platformInfo undefined here? When someone does a build and pack on a machine architecture we don't officially support? Or are we going to start producing platform agnostic builds of the whole extension?

@allisonchou
Copy link
Contributor Author

According to @dibarbet we don't actually publish the platform agnostic extension in the marketplace today, so essentially this PR is for future proofing more than anything. Due to this I think this would be fine to merge and just update the versions in the next Razor update

@davidwengier
Copy link
Member

Sounds good, thanks for clarifying. Either @ryzngard will be doing an insertion today, or I'll do one on my Monday, so it won't be in this state for long anyway.

@allisonchou allisonchou merged commit d27b1bc into dotnet:main Oct 27, 2023
@allisonchou allisonchou deleted the dev/allichou/RazorPlatformAgnostic branch October 27, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants