astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
29.16k stars 949 forks source link

Update annotate-snippets to 0.11.0 #10832

Open MichaReiser opened 3 months ago

MichaReiser commented 3 months ago

See https://github.com/astral-sh/ruff/pull/10699

CC: @carljm in case you plan to work on this.

We may also decide not to use annotate-snippets anymore (it has some weirdness like it supports some markup that can mess up rendering)

dhruvmanila commented 3 months ago

This will be useful for the new parser test cases as well. If I understand this correctly, https://github.com/rust-lang/annotate-snippets-rs/pull/107 allows highlighting empty spans which can occur at EOF. You might've noticed that there are no error messages in some of the cases :)

MichaReiser commented 3 months ago

Oh nice, that annoyed me for a long time. I think we should also change the expected errors to point to an empty range that starts at the next token's position instead of using the entire range of the next token.