Skip to content

Add diagnostics for missing/broken Symbol Links in DocC comments, Tutorial and Markdown files #2729

Open
Padmashree06 wants to merge 16 commits into
swiftlang:mainfrom
Padmashree06:diagnostics-new
Open

Add diagnostics for missing/broken Symbol Links in DocC comments, Tutorial and Markdown files #2729
Padmashree06 wants to merge 16 commits into
swiftlang:mainfrom
Padmashree06:diagnostics-new

Conversation

@Padmashree06

Copy link
Copy Markdown
Contributor

This PR adds diagnostics for unresolved symbol links in DocC comments, Markdown, and Tutorial files, using both push and pull diagnostics. For Swift files, where both SwiftLanguageService and DocumentationLanguageService can report diagnostics, the responses from both are merged into a single combined report.

Changes

  • Adds both push and pull diagnostics in DocumentationLanguageService for unresolved symbol references.
  • For .swift files, merges diagnostics from both SwiftLanguageService and DocumentationLanguageService into a single response (generalizes handleRequest to support merging responses across language services via an optional combine parameter so that the existing callers are unaffected since none of them pass combine).
  • Falls back to push diagnostics only when the pull diagnostics is not supported by the client.
  • For .swift files the push notifications of both SwiftLanguageService and DoucumenattionLanguageService are merged and sent to the client.
  • Symbol graph is considered as the source of truth to resolve the Symbol links. If the symbol graph is not available (module hasn't built or failed to build) no diagnostics are reported.

User Impact

Users now see diagnostics (red squiggles) for unresolved symbol links in DocC comments, Markdown and Tutorial files, reported via pull diagnostics where supported and push diagnostics otherwise.

@ahoppen ahoppen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is pretty much blocked on the same underlying issues of generating the symbol graph in the background as #2698, right?

@snprajwal

snprajwal commented Jul 23, 2026

Copy link
Copy Markdown

Yes, this will also get refactored, so it might be good to hold off on review until that happens (at least for the bits that use the existing symbol graph logic).

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.

3 participants