Skip to content

Handle Razor text views without adapters - #85863

Open
davidwengier wants to merge 1 commit into
dotnet:mainfrom
davidwengier:razor-view-connections
Open

davidwengier wants to merge 1 commit into
dotnet:mainfrom
davidwengier:razor-view-connections

Conversation

@davidwengier

@davidwengier davidwengier commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Our code was assuming a text view adapter would always be present, but that isn't true for the multi-view diff experience in VS.

Microsoft Reviewers: Open in CodeFlow

@davidwengier
davidwengier requested review from a team and kayle October 1, 2026 02:10
@davidwengier
davidwengier requested a review from a team as a code owner October 1, 2026 02:10
Copilot AI balanced review requested due to automatic review settings October 1, 2026 02:10
@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.

Copilot review overview

🟢 Approval recommended

The focused fix follows established adapter patterns and has comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Handles Razor multi-view diff text views when native VS adapters are unavailable.

Changes:

  • Makes buffer and view adapters optional.
  • Continues managed editor setup without a view adapter.
  • Adds exhaustive adapter/scenario tests.
File Description
RazorLSPTextViewConnectionListener.cs Safely handles missing adapters.
RazorLSPTextViewConnectionListenerTest.cs Tests all adapter, client, and buffer combinations.

// ** Content Type Mappings **
// RazorCSharp = .NET Framework Razor editor
// RazorCoreCSharp = .NET Core Legacy Razor editor
// Razor = .NET Core Razor editor (LSP / new)

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.

is there any plan to unify these all on the new LSP model? Let me know if there's anything we can do on the editor side to simplify it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

RazorCoreCSharp can probably be deleted, it should be never used and cohosting was effectively unifying it onto the LSP editor. I've made a note for myself. RazorCSharp (the .NET Framework editor) is not going anywhere, doesn't get worked on, isn't owned by our team.

This branch has not been deployed

No deployments
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