Skip to content

Ellipsis for diagnostics spanning large files#63

Merged
johnyob merged 1 commit intojohnyob:mainfrom
giltho:big-files
Feb 11, 2026
Merged

Ellipsis for diagnostics spanning large files#63
johnyob merged 1 commit intojohnyob:mainfrom
giltho:big-files

Conversation

@giltho
Copy link
Contributor

@giltho giltho commented Feb 4, 2026

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_renderer for a test after.

Fixes #54

@giltho
Copy link
Contributor Author

giltho commented Feb 9, 2026

Oh didn't see the build wasn't passing actually. Will fix tomorrow

@johnyob johnyob force-pushed the big-files branch 2 times, most recently from ca0b8c1 to e63a141 Compare February 11, 2026 11:57
Copy link
Owner

@johnyob johnyob left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

@johnyob
Copy link
Owner

johnyob commented Feb 11, 2026

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>
@giltho
Copy link
Contributor Author

giltho commented Feb 11, 2026

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 johnyob merged commit 32d5247 into johnyob:main Feb 11, 2026
9 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Eliding ranges

2 participants