Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Remove all diagnostic parsing except json one #1

Closed
KalitaAlexey opened this issue Dec 18, 2016 · 11 comments
Closed

Remove all diagnostic parsing except json one #1

KalitaAlexey opened this issue Dec 18, 2016 · 11 comments
Assignees
Labels

Comments

@KalitaAlexey
Copy link
Member

KalitaAlexey commented Dec 18, 2016

Hi everybody,

Cargo supports emission of messages (warnings and errors) in JSON since 1.13

I don't think that anyone still uses lower version.

I want to remove all parse code of old formats.

I am going to do that in 3 days.

Has anyone any objections?

Best regards,
Alexey

@W4RH4WK
Copy link
Contributor

W4RH4WK commented Dec 19, 2016

Apart from the fact that not many people may have found this repository yet, I am fine with it. I don't think parsing the raw text would give use any benefit and the "problems" panel is easiert to read anyway than the output panel.

@KalitaAlexey
Copy link
Member Author

I can actually print parsed warnings and errors to the output panel, but I want to parse only JSON.

@Jascha-N
Copy link
Contributor

I think it would be even better to just pass --message-format json to cargo. It makes both rustc and cargo output JSON messages. No more unnecessary rebuilds because the RUSTFLAGS environment variable changed between builds.

@KalitaAlexey
Copy link
Member Author

Hi @Jascha-N,

I thought about it. When --message-format json is used, then cargo emits output only at end.

@Jascha-N
Copy link
Contributor

Strange, not in the version I'm using: cargo 0.16.0-nightly (ddb5c32 2016-12-16). It seems to flush after every message.

The problem I have with the current RUSTFLAGS solution is that if I manually want to run cargo from the terminal after building with JSON errors enabled in the extension, it has to rebuild everything from scratch. And for the project I'm working on, that takes almost 2 minutes.

@KalitaAlexey
Copy link
Member Author

Hi @Jascha-N,

As I said before I had thought about it.
Could you paste a link to gist with the output of cargo?

@Jascha-N
Copy link
Contributor

@KalitaAlexey
Copy link
Member Author

KalitaAlexey commented Dec 19, 2016

@Jascha-N, It is strange. I saw another output. I will re-check.

@KalitaAlexey
Copy link
Member Author

KalitaAlexey commented Dec 19, 2016

Hi @Jascha-N,
I checked it with the rustup with the latest stable toolchain.
It works like in the attached gist.

@KalitaAlexey
Copy link
Member Author

I see only one problem here, which is a complex problems like in the code:

fn main() {
    let mut x: &i32 = &5;
    {
        let y = 5;
        x = &y;
    }
}

We can show all errors this is what I think the best choice.
I tried to use CodeLens, but CodeLens doesn't use their range.

@KalitaAlexey
Copy link
Member Author

I will start implementing it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants