Skip to content

[Sonic] Create a way to do sonic tooling development and keep some kind of sanity - #84008

Merged
davidwengier merged 3 commits into
features/sonicfrom
dev/dawengie/MakeSonicDevEasier
Jun 4, 2026
Merged

[Sonic] Create a way to do sonic tooling development and keep some kind of sanity#84008
davidwengier merged 3 commits into
features/sonicfrom
dev/dawengie/MakeSonicDevEasier

Conversation

@davidwengier

@davidwengier davidwengier commented Jun 4, 2026

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings June 4, 2026 08:14
@davidwengier
davidwengier requested a review from a team as a code owner June 4, 2026 08:14

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 introduces a SONICDEV-gated “prototype” workflow intended to surface decl/impl-split awareness gaps via [Obsolete] warnings, adds bool-based overloads to explicitly choose which generated document to operate on, and removes a few unused helper methods to reduce surface area.

Changes:

  • Add SONICDEV-conditional [Obsolete] annotations to steer callers toward decl/impl-aware APIs.
  • Add bool overloads on snapshots to select impl vs decl generated output/syntax trees.
  • Remove unused helper APIs (e.g., document-position helpers and minimal C# range computation).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Razor/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs Adds decl/impl-aware GetCSharpSyntaxTreeAsync(bool, ...) for test snapshots and wires the existing overload through it.
src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs Removes unused TryGetDocumentPositionInfo helpers.
src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs Adds decl/impl-aware generated-document and syntax-tree APIs; adds SONICDEV-gated obsoletion to push callers to the explicit overloads.
src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs Updates the snapshot contract to include an explicit decl/impl-aware syntax-tree overload.
src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs Adds SONICDEV-gated obsoletion to C# source text retrieval to encourage choosing the right C# document.
src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RazorCodeDocumentExtensions.cs Adds decl/impl-aware hint-name mapping and SONICDEV-gated obsoletion for APIs that implicitly pick impl.
src/Razor/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/ProjectExtensions.cs Adds SONICDEV-gated obsoletion to steer callers away from impl-only helper overloads.
src/Razor/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeDocument.cs Adds SONICDEV-gated obsoletion to impl/decl-specific accessors in favor of the bool-based APIs.
src/Razor/Directory.Build.props Adds a (currently commented) way to enable SONICDEV for local builds.

Comment thread src/Razor/Directory.Build.props
@davidwengier davidwengier changed the title Create a way to do sonic tooling development and keep some kind of sanity [Sonic] Create a way to do sonic tooling development and keep some kind of sanity Jun 4, 2026
Co-authored-by: David Wengier <david.wengier@microsoft.com>
Copilot AI review requested due to automatic review settings June 4, 2026 11:15

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings June 4, 2026 11:53

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

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

:shipit:

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.

3 participants