Skip to content

[Sonic] Test cleanup - #84224

Merged
davidwengier merged 7 commits into
dotnet:features/sonicfrom
davidwengier:SonicTests
Jun 22, 2026
Merged

[Sonic] Test cleanup#84224
davidwengier merged 7 commits into
dotnet:features/sonicfrom
davidwengier:SonicTests

Conversation

@davidwengier

@davidwengier davidwengier commented Jun 22, 2026

Copy link
Copy Markdown
Member

Completion was the last feature that needed work, but it seems there were some tests still outstanding.

This is essentially the last tooling PR for sonic, other than removing obsolete attributes etc. once we decide on API shape etc. As far as tooling is concerned though, I believe this means the feature branch can be merged.

Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings June 22, 2026 07:49
@davidwengier
davidwengier requested a review from a team as a code owner June 22, 2026 07:49

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 change set updates Razor/Sonic tooling test infrastructure and unit tests to account for the generated C# impl/decl split, and re-enables previously skipped rename/code-action test coverage by mapping edits across both generated documents when present.

Changes:

  • Re-enabled previously skipped cohost rename/code-action tests and updated them to choose the correct generated document (impl vs decl) based on document mapping.
  • Updated span/text-change mapping in tests to consider both generated documents (impl + optional decl) when validating Razor edit remapping.
  • Refactored/updated supporting test infrastructure to use the newer GetRequiredCSharpDocument(declarationDocument: false) API and to track optional declaration output where applicable.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Razor/src/Razor/test/Microsoft.VisualStudioCode.RazorExtension.UnitTests/Endpoints/Rename/RoslynRenameTest.cs Re-enables the VS Code cohost rename test.
src/Razor/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.UnitTests/Cohost/CohostRoslynRenameTest.cs Updates rename tests to select impl/decl generated docs correctly and map changes across both.
src/Razor/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.UnitTests/Cohost/CohostRoslynCodeActionTest.cs Updates code action tests to map edits against both generated docs and factors mapping into a helper.
src/Razor/src/Razor/test/Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests/RazorDocumentMappingServiceTest.cs Migrates mapping tests to use GetRequiredCSharpDocument(declarationDocument: false).
src/Razor/src/Razor/test/Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests/Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests.projitems Removes the deleted excerpt test base from compilation inputs.
src/Razor/src/Razor/test/Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests/DocumentExcerpt/RazorDocumentExcerptServiceTest.cs Inlines former base-class setup and adds coverage for declaration-document excerpt/classification scenarios.
src/Razor/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs Updates integration test compilation pipeline to handle optional decl output and adjusts syntax tree tracking accordingly.

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.

3 participants