Commit Graph
7 Commits
Author SHA1 Message Date
Richard Smith 8d45530c5f Add a note: prefix to all notes. (#4330)
Omit the `note: ` prefix and the snippet from the "in import" note that
precedes a diagnostic.

This makes our diagnostic output more closely match that of Clang and
GCC.
2024-09-23 23:59:25 +00:00
Jon Ross-Perkins b5d28f2c4b location -> loc abbreviation (#3826) 2024-03-28 18:15:18 +00:00
Jon Ross-Perkins 93e40289dd Collapse diagnostic errors and notes into a single vector. (#3805)
On #3792 it was requested to put context-related diagnostic messages
prior to the diagnostic error. In order to support that, remove the
distinction that an error needs to come first on DiagnosticMessage.
2024-03-21 23:52:51 +00:00
Jon Ross-Perkins 4421a75c36 file_name -> filename (#3791)
I wanted to choose one or the other. I think some code has been using
each from early on. We're predominately using `filename`, so
consolidating on that. This conveniently matches the [Google dev doc
style guide](https://developers.google.com/style/word-list#filename)
(which we use for docs) which says "filename: Not file name".

In toolchain:

```
╚╡git grep file_name . | wc -l
35
╚╡git grep filename . | wc -l
489
```
2024-03-18 17:26:24 +00:00
Jon Ross-PerkinsandChandler Carruth 04d3901b7f Switch Diagnostic structure to use DiagnosticMessage to avoid pointers (#2502)
Followup for #2490 

The switch of DiagnosticMessage to have DiagnosticMessage means we don't need to use unique_ptr. This means that copy constructors are implicit again and don't need to be avoided, but per discussion still keeping with moves. Comments on HandleDiagnostic try to capture the use of moves there.

I'm keeping DiagnosticLevel at the top-level, and adding some checking that notes are actually Notes.

Also, adding MakeMessage to unify some of the logic (this has particularly been bugging me around format_fn, and I ran into it here because of the Diagnostic -> DiagnosticMessage change). The addition of NoTypeDeduction is intended to avoid some duplicative comments that'd been piling up.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-12-28 16:47:33 -08:00
Jon MeowandRichard Smith aaca540a05 Restructure Diagnostic objects to allow late formatting (#1131)
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-04-04 10:59:09 -07:00
Jon Meow 2296ceb56c Add a Diagnostic printer for tests. (#1087) 2022-02-15 08:35:05 -08:00