PistonDevelopers / VisualRust

Visual Studio extension for Rust
MIT License
702 stars 72 forks source link

Rust error format updates and IDE support #229

Closed sophiajt closed 7 years ago

sophiajt commented 8 years ago

I'm not sure if this will impact you, but I wanted to mention that we're currently talking about updating the Rust error format. For plugins using a regex style parse of the errors, this will likely have some impact.

If this PR is accepted, it will only initially impact the nightly builds. There are some weeks between the PR going it and a stable release including the new format. We'd like to use that time to make the transition as easy as possible.

As part of the PR, we're also enabling a supported JSON mode which IDE plugins can optionally use. It has the same information as the error text, but in a more structured way.

Please feel free to jump in on the PR thread and let us know if this impacts your plugin.

Boddlnagg commented 8 years ago

This does indeed impact VisualRust, also compare #113. I might be able to work on porting the error recognition to use the JSON mode, once the PR has landed. In order to support previous rustc versions (and current stable), we probably need to switch modes based on the rustc version.

Vbif commented 8 years ago

I have already written some code for json error in https://github.com/Vbif/VisualRust/tree/json_error_format

Boddlnagg commented 8 years ago

@Vbif: This looks quite good, thanks! I think that using JSON errors shouldn't be a build option, though. Instead, VisualRust should transparently choose which error format is best, based on the version of rustc. It should never use -Z unstable-options now that this is becoming stable. Could you change this and open a PR?

@vosen: What do you think?

Vbif commented 8 years ago

@Boddlnagg remove unstable is easy. How can i determine rustc version? First run rustc with --version every build?

Boddlnagg commented 8 years ago

@Vbif That is a very good question, and I don't have a good idea yet. Maybe it's possible to run rustc -V in the beginning of each "session", i.e. whenever a project is opened? I don't know a lot about the project system though, and this might not work at all, because the error parser is only part of the MSBuild plugin for Rust, and there probably is no "session". Probably running rustc -V on every build as you proposed is the easiest way to make this work in the short term, and we can still change/optimize it later. I think that some kind of toolchain version detection is also useful for other parts.

Vbif commented 8 years ago

https://github.com/PistonDevelopers/VisualRust/pull/230

sophiajt commented 8 years ago

Great to see some progress here!

Friendly reminder - I'm going to each plugin and letting them know we're 17 days away from Rust 1.12 being released. This is the first release that uses the new error format (and removes support for the old format). It also has the standardized JSON errors.

Boddlnagg commented 8 years ago

@jonathandturner Thanks for the reminder! We're going to be able to push this PR through the finish line until the release of 1.12, but I can't do a VisualRust release. I think only @vosen (this project's official maintainer) can do that, and he hasn't responded in the last weeks.

Boddlnagg commented 8 years ago

230 has been merged.