Stream: t-compiler/wg-diagnostics

Topic: using annotate-snippets-rs


Manish Goregaokar (Mar 09 2019 at 04:42, on Zulip):

Hey, so a colleague of mine wrote https://crates.io/crates/annotate-snippets for formatting rustc-like diagnostics output. Do y'all think we should try to polish that up and use it as a crate directly? IIRC it's more or less feature compatible with the current diagnostics formatting. Would be nice to move code out of tree.

cc @Esteban Küber @oli

Manish Goregaokar (Mar 09 2019 at 04:43, on Zulip):

https://www.reddit.com/r/rust/comments/aydqwr/roadmap_rfc_for_2019/

Esteban Küber (Mar 09 2019 at 05:54, on Zulip):

I'll take a look at it

Esteban Küber (Mar 09 2019 at 05:56, on Zulip):

Is he interested in catering to our use case? I was thinking we'd end up extracting the existing machinery out into a crate

Philipp Hansch (May 23 2019 at 05:48, on Zulip):

I'm currently looking for a way to split this up into smaller parts. I would really like to work on this, but I don't have enough free time to do it all at once

Philipp Hansch (May 25 2019 at 11:29, on Zulip):

ok, using a new error-format and a separate EmitterWriter I can now successfully print nothing instead of the human output

Philipp Hansch (May 25 2019 at 11:29, on Zulip):

I'm not sure if it makes sense to open a PR for just this, so I'll continue and try to get at least some output using annotate-rs

oli (May 25 2019 at 15:26, on Zulip):

heh, we should do $something at least. Like even just dump the main diagnostic message at file:1:1

oli (May 25 2019 at 15:26, on Zulip):

(via annotate-rs)

oli (May 25 2019 at 15:26, on Zulip):

at that point I'd be fine with merging so further development can continue without having to do all the boilerplate or bitrotting cleanup

Philipp Hansch (May 28 2019 at 06:22, on Zulip):

Quick update: #61191 is a first refactoring extraction from the things I'm doing. I'm currently figuring out how to get the diagnostic code lines for each emitted diagnostic. Once that's done I'll open up a PR with the initial work.

Philipp Hansch (May 28 2019 at 06:26, on Zulip):

The nice thing about using annotate-rs is that it forces us to separate the diagnostics data collection from the rendering. The current code is ..a good refactoring challenge :sweat_smile:

Philipp Hansch (May 28 2019 at 06:26, on Zulip):

I don't know if it will have performance implications, though

Philipp Hansch (May 31 2019 at 20:16, on Zulip):

Initial PR is up: https://github.com/rust-lang/rust/pull/61407

Philipp Hansch (Jun 05 2019 at 11:18, on Zulip):

Now that the initial PR is merged, I want to do some small cleanups

Philipp Hansch (Jun 05 2019 at 11:18, on Zulip):

after that I think we can turn https://github.com/rust-lang/rust/issues/59346 into a tracking issue and create new issues for the various FIXMEs. what do you think?

Philipp Hansch (Jun 05 2019 at 11:21, on Zulip):

i.e.

oli (Jun 05 2019 at 11:23, on Zulip):

:+1:

Philipp Hansch (Jun 13 2019 at 19:08, on Zulip):

I hope to have the separate issues for actionable tasks created today

Philipp Hansch (Jun 13 2019 at 19:08, on Zulip):

I'm don't think that FIXMEs that require further investigation should get their own issues already

Philipp Hansch (Jun 13 2019 at 19:09, on Zulip):

For example https://github.com/rust-lang/rust/blob/57a3300c2538fd1044ce45d9ef3b82182acb57ae/src/librustc_errors/annotate_snippet_emitter_writer.rs#L118 is not really worth it's own issue but should be investigated at some point

Philipp Hansch (Jun 14 2019 at 12:59, on Zulip):

^ Created #61809 #61810 and #61811

Philipp Hansch (Aug 08 2019 at 07:50, on Zulip):

It's been two months and #61811 is done now; I wish I had more time to work on both Clippy and rustc diagnostics :sweat_smile:

Philipp Hansch (Aug 08 2019 at 07:51, on Zulip):

I want to get back to the other two issues by end of August, unless someone else wants to have a go at them

Last update: Nov 15 2019 at 10:15UTC