You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No more project.razor.bin files (in VS, at least) (#10475)
This is a pretty substantial pull request, so I'm getting it out there
for review. I have not fully tested the change with VS Code, but Visual
Studio is working ok.
This change completely refreshes all of the machinery around how
`RazorProjectInfo` instances are passed from the Razor language client
to the Razor language server. This is generally a complicated process
with a lot of potential for reliability issues. The language client is
expected to serialize a `RazorProjectInfo` instance representing a
project update to a known location within the project's folder on disk.
The language server watches for writes to that file (the dreaded
`project.razor.bin` file, deserializes it and updates the server's
project system.
Here's how things work after this change:
- There is a new `IRazorProjectInfoDriver` abstraction that is
optionally passed into `RazorLanguageServer` when it is created.
- The language server connects an `IRazorProjectInfoListener` to the
driver and is notified of project updates and removes. For an update,
the listener is provided a `RazorProjectInfo` instance. For a remove,
it's just given a `ProjectKey`.
- In the language server, `RazorProjectService` provides the
`IRazorProjectInfoListener` implementation. This results in a much
simpler system with less machinery, allowing several "file detectors"
and "state syncrhronizers" to be deleted.
- For Visual Studio, an `IRazorProjectInfoDriver` is provided to the
language server performs no serialization/deserialization of
`RazorProjectInfo` instances. Instead, the language client and server
just shared the same `RazorProjectInfo` instances. I'm expecting this to
lead to performance and memory allocation wins.
- For Visual Studio Code, no `IRazorProjectInfoDriver` implementation is
provided. So, the language server falls back to a special
`FileWatcherBasedRazorProjectInfoDriver` implementation that watches the
workspace folder. The `RazorWorkspaceListener` in
`ExernalAcess.RoslynWorkspace` still serializes `RazorProjectInfo`
instances for VS Code. So, that should work as it did before, though I
still need to test it. (I'd happily accept any help on this.)
Significant deletions from the language server in this change:
- `ProjectConfigurationFileChangeDetector`
- `ProjectConfigurationFileChangeEventArgs`
- `ProjectConfigurationStateSynchronizer`
- `MonitorProjectConfigurationFilePathEndpoint`
- `ProjectConfigurationStateManager`
- `ProjectInfoEndpoint`
- `RazorProjectInfoDeserializer`
Significant deletions from VS in this change:
- `ProejctConfigurationFilePathChangedEventsArgs`
- `ProjectConfigurationFilePathStore`
- `RazorProjectInfoEndpointPublisher`
- `RazorProjectInfoFileSerializer`
- `RazorProjectInfoPublisher`
Razor-CI for PR Validation:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2473027&view=results
Copy file name to clipboardexpand all lines: src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorLanguageServerBenchmarkBase.cs
+1-1
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ public RazorLanguageServerBenchmarkBase()
Copy file name to clipboardexpand all lines: src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/ConfigurableLanguageServerFeatureOptions.cs
-6
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,9 @@ internal class ConfigurableLanguageServerFeatureOptions : LanguageServerFeatureO
0 commit comments