Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPossible Rust error format updates and IDE support #146
Comments
This comment has been minimized.
This comment has been minimized.
|
Hello! As I see it, some simple JSON would be more convenient, for example something like this: {
"lineFrom": 0,
"lineTo": 10,
"characterFrom": 0,
"characterTo": 6,
"severity": "error" | "warning",
"message": "",
}But maybe other guys have other ideas. |
This comment has been minimized.
This comment has been minimized.
|
Rustc does have support for emitting json logs, and it is really easy to use, my only issue with it is that we can't get the usual log along with it, so our output window won't show the same stuff it would if we were building on the terminal. |
This comment has been minimized.
This comment has been minimized.
wycats
commented
Jul 14, 2016
|
@jonathandturner maybe we could include the "text" version of the message inside of the JSON? |
This comment has been minimized.
This comment has been minimized.
|
@wycats - thanks for the reminder! I started a thread on the Rust internals list about stabilizing the json format, which includes adding a field for the fully rendered compiler message: https://internals.rust-lang.org/t/stabilizing-json-compiler-message-output/3691 |
This comment has been minimized.
This comment has been minimized.
|
I took a look at implementing this. I don't think it will be difficult at all, but there are a few potential annoyances: To implement this on all cargo tasks, we could use the The other option is to pass in the A hybrid approach might be desirable where linters (cargo check/cargo clippy/etc) take the arguments on the command line, but build/run/bench/test take the environment variable. This would allow people who use the IDE for linting/formatting to be unimpeded by constant rebuilds as they switch between the terminal and IDE. @jonathandturner Do you have any ideas? |
saviorisdead
added
the
discussion
label
Jul 29, 2016
This comment has been minimized.
This comment has been minimized.
|
If you put the flag in RUSTFLAGS, you're only doing it the one time, right? If so, wouldn't that be a single rebuild? |
This comment has been minimized.
This comment has been minimized.
|
From the IDE's point of view, yes. If, however, you decide to build it from a terminal then I understand the reasoning behind it as you definitely want a rebuild if you change optimization settings or what have you, but the error output shouldn't (in my opinion) have such an impact. |
trixnz
referenced this issue
Jul 29, 2016
Closed
Allow the unstable --error-format flag to be changed from an environment variable #1693
This comment has been minimized.
This comment has been minimized.
|
I've created a feature request at rust-lang/rfcs#1693 for an environment variable that only affects the error format. Suggest we continue discussions there. |
trixnz
referenced this issue
Aug 2, 2016
Merged
Add support for JSON error format and new (RUST_NEW_ERROR_FORMAT=true) error style #159
This comment has been minimized.
This comment has been minimized.
|
#159 adds support for JSON errors and I'll look into adding support for the new error format during the week |
This comment has been minimized.
This comment has been minimized.
|
Sounds like this is in-progress, but I wanted to give you all a heads up that we're currently discussing turning the new error format on: rust-lang/rust#35401 If there are any issues, please let us know. Making the switch will only affect nightly, and there will still be some weeks before this goes into stable, which gives us some time to make changes if need be. |
This comment has been minimized.
This comment has been minimized.
|
Awesome! |
jonathandturner commentedJun 9, 2016
Hi all,
Sorry for using the issue as a message box, but I wanted to let you know that we're working on an RFC that updates the error messages output format: rust-lang/rfcs#1644 If RustyCode is currently parsing the output from the compiler may be impacted.
That said, we're also talking about standardizing a JSON format to help give IDEs more information from compiler output.
Would love to chat about the VSCode support (which I use pretty much everyday :) ), and get your thoughts.