Commit Graph

5 Commits

Author SHA1 Message Date
Doug Gregor
5b5a3e3d07 Point at diagnostic group documentation on docs.swift.org 2025-04-14 20:08:24 -07:00
Doug Gregor
b182c96bd7 Print diagnostic group names by default
Print diagnostic groups as part of the LLVM printer in the same manner as the
Swift one does, always. Make `-print-diagnostic-groups` an inert option, since we
always print diagnostic group names with the `[#GroupName]` syntax.

As part of this, we no longer render the diagnostic group name as part
of the diagnostic *text*, instead leaving it up to the diagnostic
renderer to handle the category appropriately. Update all of the tests
that were depending on `-print-diagnostic-groups` putting it into the
text to instead use the `{{documentation-file=<file name>}}`
diagnostic verification syntax.
2025-03-29 15:40:56 -07:00
Doug Gregor
fc508daaf7 [Serialized diagnostics] Emit category documentation URL
Emit the category documentation URL into serialized diagnostics as part of
the existing RECORD_CATEGORY, using the form

  <category name>@<category URL>

and keeping the existing "category name length" field referring to the
length of the category name itself (up to the @). There is a corresponding
update to libclang to process such category names correctly and add
API, but it isn't strictly necessary: readers that use the category
name length field correctly will see no behavior change, whereas
readers that ignore it will merely see the extra `@<category URL>`.

This is a step toward staging out our (mis)use of the "flags" field as
the place to stash educational note and diagnostic group documentation
URLs.
2025-03-22 14:27:29 -07:00
Doug Gregor
aafd24bfed Prefer diagnostic group names for diagnostic categories over the ad hoc ones 2025-02-27 19:40:23 -08:00
Doug Gregor
779acb3d15 [Diagnostics] Record diagnostic groups in serialized diagnostics
The serialized diagnostic format has some extra fields that we can
adopt for diagnostic groups. Specifically:
* Category: store the diagnostic group name here
* Flags: extend the hack used by educational notes of placing Markdown file paths here
2025-02-27 17:26:48 -08:00