Skip to content

Diagnostic sorting#6699

Merged
jonmeow merged 5 commits intocarbon-language:trunkfrom
jonmeow:prop-diag-sort
Feb 11, 2026
Merged

Diagnostic sorting#6699
jonmeow merged 5 commits intocarbon-language:trunkfrom
jonmeow:prop-diag-sort

Conversation

@jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Feb 6, 2026

Change SortingConsumer from sorting by last processed token (per-phase) to
additionally allow diagnostics to request sorting by start position (line and
column) when the last processed token is the same.

Assisted-by: Google Antigravity with Gemini 3 Flash

@jonmeow jonmeow added proposal A proposal proposal draft Proposal in draft, not ready for review labels Feb 6, 2026
Assisted-by: Google Antigravity with Gemini 3 Flash
@jonmeow jonmeow marked this pull request as ready for review February 7, 2026 00:42
@jonmeow jonmeow requested review from a team as code owners February 7, 2026 00:42
@jonmeow jonmeow requested review from dwblaikie and zygoloid and removed request for a team and dwblaikie February 7, 2026 00:42
@github-actions github-actions bot added proposal rfc Proposal with request-for-comment sent out toolchain and removed proposal draft Proposal in draft, not ready for review labels Feb 7, 2026
@jonmeow jonmeow requested review from chandlerc and removed request for zygoloid February 7, 2026 00:44
@jonmeow
Copy link
Contributor Author

jonmeow commented Feb 7, 2026

@chandlerc Moving this way since normally I wouldn't have made this a proposal, but you requested it as part of discussion of #6641, so I'm trying to figure out the expected threshold for toolchain proposals.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Generally, LG, and nice to have this documented.

Some editorial stuff and a question about where best to put the alternatives discussion.

Comment on lines 76 to 79
## Alternatives considered

Alternatives are in the
[toolchain design](/toolchain/docs/diagnostics.md#diagnostic-sort-alternatives).
Copy link
Contributor

Choose a reason for hiding this comment

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

I had imagined following a similar structure to what we've been doing with the language design, where the design just has a short list of alternatives, and the actual discussion is kept in the proposal doc.

Did I give a different impression in the discussion? If so, I may have just misspoken...

Or is there something that makes you prefer this structure?

Copy link
Contributor Author

@jonmeow jonmeow Feb 9, 2026

Choose a reason for hiding this comment

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

Sorry, this is a detail I heard from you -- I just don't think it came up. I'd assumed we'd continue to document alternatives in the toolchain's design, as has been done in the past. For example:
https://github.com/search?q=repo%3Acarbon-language%2Fcarbon-lang%20path%3Atoolchain%2Fdocs%20%22Alternatives%20considered%22&type=code

Since it sounds like your preference is to use proposals for more, would you suggest moving all the existing alternative documentation out to proposals for consistency? (or is being consistent with the existing documentation good?)

Note too, I think other documentation has included some alternative documents inline.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure there is a lot of value to retroactively moving stuff around, particularly for the toolchain.

But we should pick the pattern we want going forward and try to be consistent with that maybe? I've been happy with the approach in the language design where the alternatives are just listed in the design but discussed in the proposal in question. But I'm open to other organization if that's better.

WDYT @zygoloid ?

Copy link
Contributor Author

@jonmeow jonmeow Feb 10, 2026

Choose a reason for hiding this comment

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

It's really not much extra work (and I think it'd be useful to move in order to avoid confusion with future contributions, especially since otherwise we'll end up with both styles in the same document) -- #6716

jonmeow and others added 3 commits February 9, 2026 14:35
Assisted-by: Google Antigravity with Gemini 3 Flash
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Also LGTM and up to you if you'd like to submit or wait for a how we want to organize stuff -- not super worried about a small amount of inconsistency either way.

Assisted-by: Google Antigravity with Gemini 3 Flash
@jonmeow jonmeow added this pull request to the merge queue Feb 11, 2026
Merged via the queue into carbon-language:trunk with commit 45b3f47 Feb 11, 2026
8 checks passed
@jonmeow jonmeow deleted the prop-diag-sort branch February 11, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal rfc Proposal with request-for-comment sent out proposal A proposal toolchain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants