Add code actions for documentation diagnostics - #85728
Open
davidwengier wants to merge 4 commits into
Open
davidwengier wants to merge 4 commits into
davidwengier wants to merge 4 commits into
Conversation
|
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. |
davidwengier
added this pull request to stack #85729
September 21, 2026 12:46
davidwengier
force-pushed
the
davidwengier/razor-doc-code-actions
branch
from
September 28, 2026 22:21
8efe3be to
f188261
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Parser-sensitive CDATA and malformed-document recovery behavior warrants final human review despite comprehensive tests.
Review effort: Balanced
Findings: None
What changed in this PR
Adds Razor quick fixes for documentation diagnostics RZ1047–RZ1049, completing the documentation-directive tooling introduced across the related PR stack.
Changes:
- Adds three diagnostic-driven code-action providers.
- Adds shared VS/VS Code tests and localized resources.
- Documents each quick fix and its edge-case behavior.
| File | Description |
|---|---|
Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests.projitems |
Includes new shared tests. |
CodeActions/WrapDocumentationInSummaryTests.cs |
Tests RZ1049 fixes. |
CodeActions/UseExplicitExpressionTests.cs |
Tests RZ1048 fixes. |
CodeActions/EscapeDocumentationCommentTerminatorTests.cs |
Tests RZ1047 fixes. |
CodeActions/CohostCodeActionsEndpointTestBase.cs |
Supports project configuration in tests. |
Resources/xlf/SR.zh-Hant.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.zh-Hans.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.tr.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.ru.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.pt-BR.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.pl.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.ko.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.ja.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.it.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.fr.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.es.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.de.xlf |
Adds localized-resource placeholders. |
Resources/xlf/SR.cs.xlf |
Adds localized-resource placeholders. |
Resources/SR.resx |
Defines action titles. |
WrapDocumentationInSummaryCodeActionProvider.cs |
Implements RZ1049 wrapping. |
UseExplicitExpressionCodeActionProvider.cs |
Implements RZ1048 expression conversion. |
RazorCodeActionFactory.cs |
Creates the new quick fixes. |
EscapeDocumentationCommentTerminatorCodeActionProvider.cs |
Implements RZ1047 escaping. |
LanguageServerConstants.cs |
Defines action identifiers. |
documentation-directive.md |
Documents quick-fix behavior. |
davidwengier
force-pushed
the
davidwengier/razor-doc-code-actions
branch
from
September 30, 2026 00:02
f188261 to
2c937e5
Compare
Contributor
There was a problem hiding this comment.
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: 2
Open (3)
FindToken(span.Start).Parentis a brittle way to locate theCSharpStatementLiteralSyntaxthat… · New Same issue as in the terminator-escape provider: relying onFindToken(...).Parentcan fail if the… · New Thisusing System;appears to be unused in this file. Removing unused usings keeps the file tidy… · New
Copilot stopped reviewing on behalf of
davidwengier due to an error
September 30, 2026 00:24
davidwengier
removed this pull request from stack #85729
October 4, 2026 21:37
A literal comment terminator cannot be emitted safely inside a documentation comment. Offer an XML-safe edit at the diagnosed occurrence, including CDATA, so users can preserve the displayed text.
The new directive changes how legacy @documentation expressions are parsed. Making the whole expression explicit preserves the old rendered result without changing the following text.
Plain text still needs explicit XML tags; the compiler should not invent them. This action adds a summary while preserving the surrounding whitespace and any existing XML.
XML-first recovery deliberately captures following text as documentation. Verify the escape action updates only the reported comment terminator in components and views.
davidwengier
force-pushed
the
davidwengier/razor-doc-code-actions
branch
from
October 4, 2026 23:31
2c937e5 to
efd04d6
Compare
davidwengier
changed the base branch from
davidwengier/razor-doc-completion
to
main
October 4, 2026 23:33
This comment was marked as outdated.
This comment was marked as outdated.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds a quick fix for each documentation diagnostic: escape comment terminators (
RZ1047), make legacy expressions explicit (RZ1048), and wrap plain text in<summary>(RZ1049). Each action has its own commit, tests, localisation and documentation.This is the final layer of the reviewed documentation split, based on #85727. Part of #85414.
Validation passed with analysers enabled and baseline generation disabled: 4,514 compiler tests, 32 Remote completion tests, 482 VS Code tests and 536 Visual Studio tests. The final tree matches the reviewed source except for the previously approved unused import removal.
Native stack registration follows once the coordinator has checked all eight PRs.
Microsoft Reviewers: Open in CodeFlow