Skip to content

Merge/sonic into main - #84778

Merged
chsienki merged 250 commits into
dotnet:mainfrom
chsienki:merge/sonic-into-main
Aug 6, 2026
Merged

chsienki merged 250 commits into
dotnet:mainfrom
chsienki:merge/sonic-into-main

Conversation

@chsienki

@chsienki chsienki commented Aug 6, 2026 •

Copy link
Copy Markdown
Member
Microsoft Reviewers: Open in CodeFlow

chsienki and others added 30 commits May 14, 2026 12:24
This is a smaller subset of dotnet#83681
that stops at the point where we are generating the decl file, but not
yet generating the impl file, or replacing the regular C# file with it.

It has a couple of new tests with baselines that show the state of the
decl doc.

Once we have this in, we can add the commits that switch over to
generating the impl docs, and flesh out how the tooling works with
multiple files.
Sonic 3.2: activate the decl/impl split.

Follows on from dotnet#83688 (Sonic 3.1: Generate Decl Files), which only
landed the infrastructure to produce a second (decl) C# document. This
PR brings over the remaining commits from the original work branch that
switch the Razor files supporting the split from emitting a single
`main` document to emitting an `impl` document alongside the `decl`
document, and updates tooling/tests to be aware of the split.
`backup/sonic-3.2-with-baselines` (sha `997fdab148f`) and will be
re-applied before this work ships.

1. `Activate the decl/impl split in the lowering phase and source
generator` -- turns on the split in the lowering pipeline and wires up
the source generator to emit both documents.
2. `Make IDE/cohosting mapping layer split-aware` -- updates
`RemoteDocumentMappingService` / `RemoteSpanMappingService` and related
extensions so source mappings consider both documents.
3. `Make integration test infrastructure split-aware` -- updates
`IntegrationTestBase` / `RazorBaselineIntegrationTestBase` /
`RazorIntegrationTestBase` to handle decl + impl baselines.
4. `Update tests for the decl/impl split` -- updates
`ComponentCodeGenerationTestBase` and related compiler tests.
I think it's 50/50 whether these helpers make it to the main branch, but for now it's really convenient to be able to obsolete all of the old methods, and be able to see which code has been modified to be explicit, and which are just using the old methods.

I realise, in hindsight, that it was my own comment on a previous PR that caused things to be in this state 🤦‍♂️
Every consumer immedately converted to an array anyway
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…t#83989)

First cab off the rank for tooling support for Project Sonic.

I'm not 100% on the APIs here but given its going to a feature branch I
think it's better to get some things working and see what the most
useful API is as it emerges.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83989)
Co-authored-by: David Wengier <david.wengier@microsoft.com>
…nd of sanity (dotnet#84008)

This is my best bet at how to make Sonic Tooling dev approachable. It
has no impact on CI builds, we'll have to remove it before merging to
main (if I understand how PROTOTYPE comments work properly), but by
setting a local define, I get a nice todo list from the error list about
what needs to be fixed.

I also found a few methods that had no callers when I was making these
changes, so I removed them. Less surface area to worry about is good.

As part of de-obsoleting everything at the end of the work, I'm open to
removing the methods that take booleans, and switching to the document
specific methods, or keeping both sets. Certainly, the boolean option is
proving useful in porting other features.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/84008)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
May as well do this in the feature branch, since doing it in main would be conflict city
This is going to be generally useful in future
Copilot AI review requested due to automatic review settings August 6, 2026 00:18
@chsienki
chsienki requested review from a team as code owners August 6, 2026 00:18

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@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.

@chsienki chsienki mentioned this pull request Aug 6, 2026
The fallback-component nested-delegate metadata limitation is tracked as
a known issue, so the skipped test carries only the issue reference
rather than a temporary marker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b8188d9c-18d2-4e12-8b25-4c8d99114193
Copilot AI review requested due to automatic review settings August 6, 2026 03:55

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings August 6, 2026 19:41

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@davidwengier

Copy link
Copy Markdown
Member

This PR is so big that GitHub didn't even want to let me approve it 🤷‍♂️
image

Switching to "single file mode" worked though

@chsienki
chsienki merged commit 5839d80 into dotnet:main Aug 6, 2026
25 checks passed
@jjonescz jjonescz mentioned this pull request Aug 8, 2026
JoeRobich pushed a commit that referenced this pull request Aug 11, 2026
Backs the `features/sonic` decl/impl split out of `main` to unblock
insertion. Reverts the merge (#84778) and the commits that stacked on
top of it and cannot stand without it.

## What reverts

- **#84778** `Merge/sonic into main` -- the whole feature body (reverted
with `-m 1`, keeping pre-sonic `main`).
- **#84818** fallback child-content discovery fix -- patches sonic's
fast/slow discovery, which no longer exists.
- **#84813** restore `GetCSharpDocument()`/`GeneratedCode` -- these were
re-added to shim sonic's API removal; reverting the merge restores the
originals, so the shim would double-define them.
- **#84795** always pass C# formatting options -- edits
`CSharpFormattingOptionsHelper.cs`, a file that only exists because of
sonic.

## What is kept

The other post-merge commits are independent of sonic and stay: arcade
bumps, SDL param removal, CS8802, #84758 (syntax-tree sharing), and the
two Razor features that merely shared files -- **#84760**
(unbound-attribute warnings) and **#84764** (empty-outer-tag warning).

Preserving #84760 needed one manual resolution in
`UnresolvedAttributeIntermediateNode.cs`: sonic added the
`CloneNode()`/`Clone()` overrides and #84760 later added one property
assignment inside `CloneNode`. The overrides are sonic infrastructure
and go with the revert; #84760's `IsDirectiveAttributeCandidate`
property and all its real usages are untouched.

## Validation

- `Razor.slnf` builds clean (compiler + all tooling projects, including
the ones #84795 touched).
- `Microsoft.NET.Sdk.Razor.SourceGenerators.UnitTests`: 215 passed.
- `Microsoft.AspNetCore.Razor.Language.UnitTests` (component / tag
helper / bind / unbound-attribute): 1593 passed -- confirms #84760's
kept feature still works.

## Note

Reverting the merge means re-landing `features/sonic` later will need
this revert itself reverted first -- expected for a back-out.

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/84831)
@jjonescz jjonescz added this to the 18.11 milestone Aug 25, 2026
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.

4 participants