Skip to content

Add documentation links to analyzer diagnostics - #4

Merged
cliedeman merged 2 commits into
mainfrom
copilot/include-links-to-documentation-in-linting-failures
May 31, 2026
Merged

Add documentation links to analyzer diagnostics#4
cliedeman merged 2 commits into
mainfrom
copilot/include-links-to-documentation-in-linting-failures

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

Analyzer failures did not expose a direct path to the corresponding rule documentation, forcing users to manually look up guidance. This change attaches rule-specific documentation URLs to the emitted diagnostics so IDEs and tooling can surface the relevant docs inline.

  • What changed

    • Added helpLinkUri to every shipped analyzer DiagnosticDescriptor.
    • Wired each diagnostic ID to its published docs page under docs/rules/....
    • Preserved the shared docs target for SWGQL05 and SWGQL06.
  • Implementation

    • Introduced a single DiagnosticHelpLinks mapping to keep rule-to-doc URLs centralized.
    • Updated all analyzer descriptors to use the shared mapping instead of embedding URLs ad hoc.
  • Guardrails

    • Added a descriptor-level test that asserts every supported diagnostic exposes the expected documentation link, so future rules do not ship without docs wiring.
public static readonly DiagnosticDescriptor Rule = new(
    id: DiagnosticId,
    title: Title,
    messageFormat: MessageFormat,
    category: Category,
    defaultSeverity: DiagnosticSeverity.Warning,
    isEnabledByDefault: true,
    description: Description,
    helpLinkUri: DiagnosticHelpLinks.For(DiagnosticId));

@cliedeman
cliedeman marked this pull request as ready for review May 31, 2026 11:54
@cliedeman
cliedeman merged commit b4260f8 into main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants