DIAG1: grouped source-window rendering for compiler diagnostics #54
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/054-diag1-grouped-source-window-rendering-for-comp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DIAG1: grouped source-window rendering for compiler diagnostics
Touches 161 files:
docs/errors/E0301.md,docs/errors/E0302.md,docs/errors/E0303.md,docs/errors/E0304.md,docs/errors/E0305.md,docs/errors/E0306.mdand 155 more.Approving. I would have split
src/rust/crates/ck_driver/src/load.rsdifferently, but not enough to hold this up.@ -113,0 +424,4 @@/// column, the caret run, its key (code or `note`), and — for a multi-line/// span — the `(spans N lines)` extent. Bold wraps the carets and key under/// [`Style::Bold`].fn push_caret_line(out: &mut String, mark: &Mark, diags: &[Diagnostic], pad: &str, style: Style) {push_caret_linereads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -147,0 +190,4 @@.or_default().push(diag.clone());}let mut out = String::new();outallocates a fresh buffer per call. If this runs per frame or per token, can the buffer be reused?It runs per token. The buffer behind
outlives on the struct insrc/rust/crates/ck_driver/src/load.rsnow and is cleared rather than reallocated.Split. The decision in
push_caret_lineis a pure function now, with its own tests insrc/rust/crates/ck_diag/src/lib.rs.