Skip to content

Delete random bits of unused Razor code - #84804

Open
davidwengier wants to merge 10 commits into
dotnet:mainfrom
davidwengier:DeleteDeadCode
Open

Delete random bits of unused Razor code#84804
davidwengier wants to merge 10 commits into
dotnet:mainfrom
davidwengier:DeleteDeadCode

Conversation

@davidwengier

@davidwengier davidwengier commented Aug 7, 2026

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings August 7, 2026 06:32
@davidwengier
davidwengier requested a review from a team as a code owner August 7, 2026 06:32
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants