AtomBuild / atom-build-cargo

Cargo (Rust) integration for Atom
MIT License
18 stars 6 forks source link

Output parsing enhancement #40

Closed alygin closed 8 years ago

alygin commented 8 years ago

I've improved parsing of output:

  1. Errors and Warnings are now fully matched with those of rustc.
  2. Notes and Helps are added to the corresponding Errors and Warnings as Info blocks of trace. They can also exist as standalone messages.
  3. Additional lines with useful information are parsed and added to the appropriet message blocks.
  4. Panics are parsed along with their Stack backtraces (which are added as elements of their trace).
  5. There's only one entry point for output parsing and it fully supports both standard human-readable output as well as JSON format.

So, all the compiler and program messages are now neatly arranged, no information is lost in both standard and JSON modes. Works well with clippy.

Please, check, if everything is ok. Any feedback on the code, usability and anything else is highly appreciated.

oli-obk commented 8 years ago

regular parsing looks good. I'm slightly confused about json, things like mismatched type don't actually show the expected/found part, even though it's definitely in the json. Is that a new issue or was that there before?

alygin commented 8 years ago

@oli-obk, I left JSON parsing intact, just moved the loop on output lines one method higher. So, if there where some issues before, they are still there and it's unlikely that I introduced new ones. But I'll have a look at the problem you described since I'm fixing things there anyway.

alygin commented 8 years ago

I've made a trivial fix in json parsing, the message you expected is displayed now. But it seems that the json structure has changed since the parser was written and now they're out of sync. I think we need a separate issue for that because some preliminary research must be done to do the work correctly.

Links are also added to submessages and a minor code refactoring performed. Please, check it out.

oli-obk commented 8 years ago

The notion of transwarp beaming is like trying to hit a bullet with a smaller bullet whilst wearing a blindfold, riding a horse.

Since the json flag has a nice warning message, let's ignore whatever happens there xD

This looks good to me. Do you have anything additional or are we good to merge?

alygin commented 8 years ago

Absolutely ) I've done with what I was aiming and think we could merge if there're no objections.