-
Notifications
You must be signed in to change notification settings - Fork 198
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
Remove Razor EA For Roslyn #11510
base: main
Are you sure you want to change the base?
Remove Razor EA For Roslyn #11510
Conversation
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 |
Feel free to ping in Teams when you're ready. |
<MicrosoftNetCompilersToolsetPackageVersion>4.14.0-dev</MicrosoftNetCompilersToolsetPackageVersion> | ||
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.14.0-dev</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion> | ||
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion> | ||
<MicrosoftCodeAnalysisCommonPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisCommonPackageVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will need to be updated once the package is available.
There was a problem hiding this 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 😛
@@ -106,11 +106,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler Tests", "Compiler | |||
EndProject | |||
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}" |
There was a problem hiding this comment.
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 😛
{ | ||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
|
||
namespace Microsoft.VisualStudioCode.RazorExtension.Endpoints; | ||
|
||
internal class RazorFileChangedResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used?
internal sealed class RazorDynamicFileUpdate | ||
{ | ||
[JsonPropertyName("edits")] | ||
public required ServerTextChange[] Edits { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have RazorTextChange
which looks the same as ServerTextChange
. Also, why not put this array directly in RazorProvideDynamicFileResponse
? Looks like there is even a debug assert to ensure there is only ever one RazorDynamicFileUpdate
anyway
|
||
file sealed class LspDynamicFileProvider(IRazorClientLanguageServerManager clientLanguageServerManager) : RazorLspDynamicFileInfoProvider | ||
{ | ||
private const string ProvideRazorDynamicFileInfoMethodName = "razor/provideDynamicFileInfo"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are two files in this project that define this. Centralize?
|
||
[ExportRazorStatelessLspService(typeof(RazorWorkspaceService)), Shared] | ||
[method: ImportingConstructor] | ||
file class WorkspaceService(ILoggerFactory loggerFactory) : RazorWorkspaceService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File name doesn't match class name. Also not sure why this is a file class. I guess it doens't hurt, but seems odd.
file class WorkspaceService(ILoggerFactory loggerFactory) : RazorWorkspaceService | ||
{ | ||
private readonly ILoggerFactory _loggerFactory = loggerFactory; | ||
private readonly ILogger _logger = loggerFactory.CreateLogger<RazorWorkspaceService>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably create a logged for WorkspaceService
, though being a file class, that type name probably looks ugly.
|
||
projectsToInitialize = _projectIdWithDynamicFiles; | ||
// May as well clear out the collection, it will never get used again anyway. | ||
_projectIdWithDynamicFiles = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you copied this code from the C# extension, where I was the one who wrote it, but I must ask Past Dave™, why not just call .Clear()
? Could make the hashset readonly. Or set the hashset to null?
{ | ||
private readonly ILoggerFactory _loggerFactory = loggerFactory; | ||
private readonly ILogger _logger = loggerFactory.CreateLogger<RazorWorkspaceService>(); | ||
private Lock _initializeLock = new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readonly?
Razor side of dotnet/roslyn#77194
Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace
, we no longer ship an EA for RoslynMicrosoft.VisualStudioCode.RazorExtension
and package that will be put in.razorExtension
in VS CodeMicrosoft.AspNetCore.Razor.ProjectEngineHost
as that layer of separation is no longer neededCopilot 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 theRazorWorkspaceListenerBase
class.Project restructuring:
Razor.sln
: RenamedMicrosoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace
toMicrosoft.VisualStudioCode.RazorExtension
and removedMicrosoft.AspNetCore.Razor.ProjectEngineHost
and its test project. [1] [2] [3]docs/ProjectsAndLayering.md
: Updated documentation to reflect the new project name.Code updates:
RazorWorkspaceListenerBase.cs
: Replaced_disposed
with_disposeTokenSource.IsCancellationRequested
for better disposal handling and added_tagHelperResolver
and_projectChecksums
fields. [1] [2] [3] [4]Project removals:
Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace
project and its related files. [1] [2] [3]