Split type inheritdoc rule into MA0197/MA0198/MA0199#1143
Merged
Conversation
Keep MA0197 as a suggestion for dedicated type documentation. Add MA0198/MA0199 warning diagnostics for ambiguous and missing inheritdoc sources on types. Add MA0198 code fixes to suggest cref from declared interfaces, and update tests and generated documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
meziantou
commented
May 8, 2026
meziantou
commented
May 8, 2026
Split MA0197, MA0198, and MA0199 into dedicated analyzers with shared helper logic, split tests into three corresponding classes, and update MA0198 cref generation to use DocumentationCommentId for code fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
meziantou
commented
May 8, 2026
meziantou
commented
May 8, 2026
meziantou
commented
May 8, 2026
meziantou
commented
May 8, 2026
Use DocumentationCommentId.CreateReferenceId for generated cref values, apply requested analyzer registration style updates, and add valid-case coverage for MA0198/MA0199 test classes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced May 8, 2026
Open
This was referenced May 11, 2026
Open
Open
Open
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.
Type-level
<inheritdoc />usage needed more precise guidance than a single warning. This change separates recommendation, ambiguity, and invalid-source cases so users get the right severity and actionable fixes.What changed
MA0197for type<inheritdoc />, but changed it to a suggestion with messaging focused on writing dedicated type documentation.MA0198as a warning for ambiguous type inheritdoc when there is no base type and multiple declared interfaces.MA0199as a warning for type inheritdoc with nocref, no base type, and no declared interfaces.MA0198that offers onecrefoption per declared interface.MA0197, newMA0198, newMA0199).README.md,docs/README.md, and analyzer pack editorconfig files).Notes for review
System.ObjectorSystem.ValueType.INamedTypeSymbol.Interfaces), not interfaces inherited through those interfaces.