Ellipsis for diagnostics spanning large files#63
Merged
johnyob merged 1 commit intojohnyob:mainfrom Feb 11, 2026
Merged
Conversation
Contributor
Author
|
Oh didn't see the build wasn't passing actually. Will fix tomorrow |
ca0b8c1 to
e63a141
Compare
johnyob
reviewed
Feb 11, 2026
johnyob
reviewed
Feb 11, 2026
Owner
|
I'll squash merge since the commit history isn't entirely clean here (since I typically use commit history to auto-generate the Changelog) |
Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
Contributor
Author
|
Yeah sorry 😅 I'm not used to clean commit messages because I squash merge everything and I just make sure the PR title is clean |
johnyob
added a commit
to johnyob/opam-repository
that referenced
this pull request
Feb 13, 2026
CHANGES: - feat(renderer): add breaks in large diagnostics ([johnyob/grace#63](johnyob/grace#63)) - feat(renderer): check for tty when rendering ([johnyob/grace#60](johnyob/grace#60)) - fix(renderer): off-by-one in `lines_of_labels` ([johnyob/grace#65](johnyob/grace#65)) - fix(renderer): create 0-sized segment on empty label range ([johnyob/grace#64](johnyob/grace#64)) - fix(renderer): renderer multi-line labels when message is empty ([johnyob/grace#53](johnyob/grace#53)) - fix(renderer): fix errors that occur with special zero-width segments ([johnyob/grace#41](johnyob/grace#41)) - fix(renderer): use `Format.pp_infinity` in `Message.to_string` for OCaml >5.2 ([johnyob/grace#40](johnyob/grace#40)) - refactor!: removes base/core dependency ([johnyob/grace#58](johnyob/grace#58)) ### BREAKING CHANGE * Many base/core interfaces from `Grace` have been replaced with custom ones. * `Source.reader` has been removed. Use `Source.Reader.t` instead.
johnyob
added a commit
to johnyob/opam-repository
that referenced
this pull request
Feb 14, 2026
CHANGES: - feat(renderer): add breaks in large diagnostics ([johnyob/grace#63](johnyob/grace#63)) - feat(renderer): check for tty when rendering ([johnyob/grace#60](johnyob/grace#60)) - fix(renderer): off-by-one in `lines_of_labels` ([johnyob/grace#65](johnyob/grace#65)) - fix(renderer): create 0-sized segment on empty label range ([johnyob/grace#64](johnyob/grace#64)) - fix(renderer): renderer multi-line labels when message is empty ([johnyob/grace#53](johnyob/grace#53)) - fix(renderer): fix errors that occur with special zero-width segments ([johnyob/grace#41](johnyob/grace#41)) - fix(renderer): use `Format.pp_infinity` in `Message.to_string` for OCaml >5.2 ([johnyob/grace#40](johnyob/grace#40)) - refactor!: removes base/core dependency ([johnyob/grace#58](johnyob/grace#58)) ### BREAKING CHANGE * Many base/core interfaces from `Grace` have been replaced with custom ones. * `Source.reader` has been removed. Use `Source.Reader.t` instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, creating a single diagnostic with labels spanning over very large files would yield the entire span of text in between the labels to be displayed in the error, leading to unusable diagnostics.
This PR simply adds an ellipsis wherever there is nothing to see.
See 800701f for a test before that and the new
test_ansi_rendererfor a test after.Fixes #54