Delete random bits of unused Razor code - #84804
Open
davidwengier wants to merge 10 commits into
Open
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a collection of unused/obsolete Razor product and test code (constants, small helper APIs, and legacy completion/telemetry plumbing) and adjusts remaining call sites accordingly to keep the codebase smaller and easier to maintain.
Changes:
- Deleted unused integration-test helpers and VS-layer helper types/constants.
- Simplified
RemoteSnapshotManager(removed telemetry dependency + removed unused APIs) and updated tests/benchmarks to use the new construction pattern. - Removed unused overloads/helpers across formatting/completion/project-system areas, and inlined the Razor configuration string in test/benchmark globalconfig generation.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Razor/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/WellKnownProjectTemplates.cs | Removed unused template constants helper. |
| src/Razor/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/WellKnownCommandNames.cs | Removed unused command name constants helper. |
| src/Razor/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/SolutionExplorerInProcess.cs | Removed unused project-template add helpers and related template-path logic. |
| src/Razor/src/Razor/test/Microsoft.CodeAnalysis.Remote.Razor.UnitTests/CodeActions/HtmlCodeActionResolverTest.cs | Updated to construct RemoteSnapshotManager without telemetry. |
| src/Razor/src/Razor/test/Microsoft.CodeAnalysis.Remote.Razor.UnitTests/CodeActions/HtmlCodeActionProviderTest.cs | Updated to construct RemoteSnapshotManager without telemetry. |
| src/Razor/src/Razor/test/Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests/RazorDocumentMappingServiceTest.cs | Updated to construct RemoteSnapshotManager without telemetry. |
| src/Razor/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/RazorProjectBuilder.cs | Inlined Razor configuration name in globalconfig text and removed unused dependency. |
| src/Razor/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestProjectData.cs | Removed dependency on deleted project-system types and added minimal local test-only HostProject/HostDocument records. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.RazorExtension/SyntaxVisualizer/SyntaxVisualizerToolWindow.cs | Removed unused GetVsService helper. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/WellKnownFeatureFlagNames.cs | Removed unused feature-flag name constants. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioHostServicesProvider.cs | Removed unused MEF-exported host-services provider. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Extensions/TextChangeExtensions.cs | Removed unused VS text-change conversion extension. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Extensions/TextBufferExtensions.cs | Removed unused VS hierarchy helpers; kept only IsRazorLSPBuffer. |
| src/Razor/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Extensions/IVsHierarchyExtensions.cs | Removed unused async wrapper. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteSolutionSnapshot.cs | Removed unused GetProject(ProjectId) overload. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteSnapshotManager.cs | Simplified to parameterless construction and removed unused telemetry + code-document API. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RazorCompletionItemResolver.cs | Removed unused override plumbing; kept static resolve entry point used by RemoteCompletionService. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/CompletionItemResolver.cs | Deleted unused abstraction. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/AggregateCompletionItemResolver.cs | Deleted unused aggregation resolver. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorRemoteHostClient.cs | Removed unused TryInvokeAsync overload. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorSyntaxFacts.cs | Removed unused syntax helper APIs. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorEventSource.cs | Removed unused event source. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs | Removed unused conversion helper. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/HostProject.cs | Deleted unused project-system model type. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/HostDocument.cs | Deleted unused project-system model type. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/FallbackRazorConfiguration.cs | Deleted unused configuration helper. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs | Removed unused From(...) overload. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/SolutionExtensions.cs | Removed unused GetRequiredDocument helper. |
| src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionTriggerAndCommitCharacters.cs | Removed unused trigger helpers. |
| src/Razor/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Formatting/DocumentFormattingBenchmark.cs | Updated to construct RemoteSnapshotManager without telemetry and inlined Razor configuration name in globalconfig text. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decided to do a pass now that sonic is merged. Was hoping for more stale completion code to come up, but I'm guessing there are more thread to pull there, and I guess they need to be done slowly.
Microsoft Reviewers: Open in CodeFlow