Skip to content

Add folding ranges for documentation directives - #85725

Open
davidwengier wants to merge 2 commits into
mainfrom
davidwengier/razor-doc-folding
Open

davidwengier wants to merge 2 commits into
mainfrom
davidwengier/razor-doc-folding

Conversation

@davidwengier

@davidwengier davidwengier commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Adds a dedicated RazorDocumentationFoldingProvider using the existing syntax-node folding base. RazorCodeBlockFoldingProvider is unchanged.

Based on #85724 (davidwengier/razor-doc-classification). The first commit adds the provider; the second adds endpoint coverage for documentation on its own and alongside code blocks.

The Remote project built with analysers before the test changes were added. The complete CohostFoldingRangeEndpointTest class passed in VS Code (net10.0, 28/28) and Visual Studio (net472, 28/28), with both new cases confirmed in the TRX results. Both changed files were formatted and exactly match the reviewed source.

Microsoft Reviewers: Open in CodeFlow

@davidwengier
davidwengier requested a review from a team as a code owner September 21, 2026 09:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

akhera99
akhera99 previously approved these changes Sep 21, 2026
dibarbet
dibarbet previously approved these changes Sep 21, 2026
Copilot AI balanced review requested due to automatic review settings September 28, 2026 22:21
@davidwengier
davidwengier force-pushed the davidwengier/razor-doc-folding branch from 25d7979 to e8bdcae Compare September 28, 2026 22:21

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 implementation follows existing patterns and has adequate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Adds folding support for Razor @documentation directives using the existing folding infrastructure.

Changes:

  • Adds and exports a documentation folding provider.
  • Adds standalone and combined directive endpoint tests.
File Description
CohostFoldingRangeEndpointTest.cs Tests documentation folding in both hosts.
RazorDocumentationFoldingProvider.cs Produces folding ranges for documentation directives.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 00:02
@davidwengier
davidwengier force-pushed the davidwengier/razor-doc-folding branch from e8bdcae to 007d7cc Compare September 30, 2026 00:02

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: None

Copilot stopped reviewing on behalf of davidwengier due to an error September 30, 2026 00:23
Copilot AI balanced review requested due to automatic review settings October 4, 2026 21:30
@davidwengier
davidwengier force-pushed the davidwengier/razor-doc-folding branch from 007d7cc to ebc6c7c Compare October 4, 2026 21:30

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 implementation is consistent, adequately tested, and has no identified correctness issues.

Review effort: Balanced
Findings: None

@davidwengier
davidwengier removed this pull request from stack #85729 October 4, 2026 21:37
Documentation blocks need their own folding behaviour without changing code-block folding. A dedicated provider follows the existing syntax-node provider pattern.
Exercise documentation and code blocks together so the new provider cannot quietly change existing folding. Run the same endpoint cases in both editor hosts.
@davidwengier
davidwengier force-pushed the davidwengier/razor-doc-folding branch from ebc6c7c to dd271dc Compare October 4, 2026 22:16
@davidwengier
davidwengier changed the base branch from davidwengier/razor-doc-classification to main October 4, 2026 22:19
@davidwengier
davidwengier dismissed stale reviews from dibarbet and akhera99 October 4, 2026 22:19

The base branch was changed.

@davidwengier

Copy link
Copy Markdown
Member Author

@dibarbet @akhera99 Now that the compiler changes are I for the language feature, and since I did the branch names wrong, I broke up the PR stack and rebased onto main, so would love a re-approval after all of that. No functional changes were made since your original review. Thanks.

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.

4 participants