Add a way for diagnostics to sort on more than last_byte_offset. (#6687)

The intent is that `last_byte_offset` is still the main sorting key.
Diagnostics issued normally (e.g. in an expression) will keep sorting
the same, and come before the new diagnostic sort. Diagnostics issued at
the end of a scope (e.g. `unused`) can request sorting by their start
location, and would become interleaved through that.

Choosing "on scope" because I think that's the main way we'll use this
functionality (on scope changes); can always rename later if usage
expands.

Assisted-by: Google Antigravity with Gemini 3 Flash
This commit is contained in:
Jon Ross-Perkins
2026-02-04 21:13:13 +00:00
committed by GitHub
parent c860c178d4
commit 45e4c71703
6 changed files with 152 additions and 37 deletions
+1
View File
@@ -22,6 +22,7 @@ constexpr Kind Kinds[] = {
constexpr Kind UntestedKinds[] = {
// These exist only for unit tests.
Kind::TestDiagnostic,
Kind::TestDiagnosticOnScope,
Kind::TestDiagnosticNote,
// Diagnosing erroneous install conditions, but test environments are