Skip to content

Conversation

ryzngard
Copy link
Contributor

@ryzngard ryzngard commented Feb 19, 2025

Razor side of dotnet/roslyn#77715

  • Remove Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace, we no longer ship an EA for Roslyn
  • Add a new Microsoft.VisualStudioCode.RazorExtension and package that will be put in .razorExtension in VS Code
    • This will contain endpoints and LSP services that will be loaded in the roslyn language server for VS Code.
  • Remove Microsoft.AspNetCore.Razor.ProjectEngineHost as that layer of separation is no longer needed

Copilot description below

This pull request includes several changes to the Razor project, focusing on project restructuring and dependency updates. The most important changes include adding a new package version, renaming and removing projects, and updating the RazorWorkspaceListenerBase class.

Project restructuring:

  • Razor.sln: Renamed Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace to Microsoft.VisualStudioCode.RazorExtension and removed Microsoft.AspNetCore.Razor.ProjectEngineHost and its test project. [1] [2] [3]
  • docs/ProjectsAndLayering.md: Updated documentation to reflect the new project name.

Code updates:

Project removals:

  • Removed Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace project and its related files. [1] [2] [3]

@davidwengier
Copy link
Member

Do you want reviews? I'll admit, the first thing I saw in here was code that used to be in ExternalAccess.RoslynWorkspace, which used to be VS Code exclusive, moved to MS.VS.RazorExtension which used to be VS exclusive, and I got very confused by what the intent was.

Then I re-read it! :)

@ryzngard
Copy link
Contributor Author

Do you want reviews? I'll admit, the first thing I saw in here was code that used to be in ExternalAccess.RoslynWorkspace, which used to be VS Code exclusive, moved to MS.VS.RazorExtension which used to be VS exclusive, and I got very confused by what the intent was.

Then I re-read it! :)

I don't think it's ready for reviews yet

@DustinCampbell
Copy link
Member

I don't think it's ready for reviews yet

Feel free to ping in Teams when you're ready.

@ryzngard ryzngard marked this pull request as ready for review March 21, 2025 00:11
@ryzngard ryzngard requested review from a team as code owners March 21, 2025 00:11
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.

Mostly LGTM. I skipped the one file with the merge conflict markers though 😛

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Microbenchmarks.Generator", "src\Compiler\perf\Microsoft.AspNetCore.Razor.Microbenchmarks.Generator\Microsoft.AspNetCore.Razor.Microbenchmarks.Generator.csproj", "{7400A168-2552-49C7-93E3-D4DAA90C216F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace", "src\Razor\src\Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace\Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace.csproj", "{2223B8FD-D98A-47BE-94A9-6A3A6B8557B8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudioCode.RazorExtension", "src\Razor\src\Microsoft.VisualStudioCode.RazorExtension\Microsoft.VisualStudioCode.RazorExtension.csproj", "{2223B8FD-D98A-47BE-94A9-6A3A6B8557B8}"
Copy link
Member

Choose a reason for hiding this comment

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

I don't know of a better name, and I don't think it matters, but I would like to state for the record that Microsoft.VisualStudio.RazorExtension is a visual studio extension and Microsoft.VisualStudioCode.RazorExtension is not a visual studio code extension 😛

Copy link
Member

Choose a reason for hiding this comment

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

I don't love the name either. It's a bit too generic, and MS.VS.RazorExtension is not something to emulate. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea... I didn't love writing it but wasn't able to come up with an alternative.

Copy link
Member

Choose a reason for hiding this comment

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

Same. 😢

using System.Collections.Immutable;

namespace Microsoft.AspNetCore.Razor.ProjectEngineHost;
namespace Microsoft.CodeAnalysis.Razor.Workspaces.ProjectEngineHost;
Copy link
Member

Choose a reason for hiding this comment

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

This can be fixed later, but we generally don't add "Workspaces" into namespaces in MS.CA.Razor.Workspaces anymore. This should probably have been Microsoft.CodeAnalysis.Razor.ProjectEngineHost, but please feel free to fix that later or tell somebody else to do it. 😄

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this (and other files moved to this folder) switch to the Microsoft.CodeAnalysis.Razor.ProjectSystem namespace?

@ryzngard ryzngard merged commit 64ba82d into dotnet:main Mar 27, 2025
12 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 27, 2025
ryzngard pushed a commit to dotnet/vscode-csharp that referenced this pull request Mar 28, 2025
@jjonescz jjonescz modified the milestones: Next, 17.14 P3 Apr 1, 2025
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.

4 participants