about summary refs log tree commit diff
path: root/src/libsyntax/json.rs
AgeCommit message (Collapse)AuthorLines
2019-11-15Move JSON emitter to rustc_errorsMark Rousskov-434/+0
2019-11-15Remove SourceMapper traitMark Rousskov-3/+3
SourceMap is now in the root of all rustc-specific crates, syntax_pos, so there's no need for the trait object to decouple the dependencies between librustc_errors and libsyntax as was needed previously.
2019-10-25Rollup merge of #65074 - Rantanen:json-byte-pos, r=matkladMazdak Farrokhzad-2/+5
Fix the start/end byte positions in the compiler JSON output Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output. This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one. The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions. Fixes #65029
2019-10-21Fix the start/end byte positions in the compiler JSON outputMikko Rantanen-2/+5
2019-10-15Refactor: Rename `db` locals to `diag`Philipp Hansch-15/+15
https://github.com/rust-lang/rust/pull/64272 replaced `DiagnosticBuilder` with `Diagnostic` in some places. This commit just renames the DB variable from `db` to `diag` where it wasn't renamed.
2019-10-13Bring attention to suggestions when the only difference is capitalizationEsteban Küber-1/+5
2019-09-24Don't emit explain with json short messages.Eric Huss-0/+7
2019-09-17Replace DiagnosticBuilder with Diagnostic when emitting errorMark Rousskov-8/+18
2019-08-21Add terminal_width debugging flagEsteban Küber-1/+1
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-11syntax: Make def-site span mandatory in ↵Vadim Petrochenkov-5/+4
ExpnInfo/MacroBacktrace/DiagnosticSpanMacroExpansion We have to deal with dummy spans anyway Remove def-site span from expander interfaces. It's not used by the expansion infra, only by specific expanders, which can keep it themselves if they want it.
2019-05-21Make -Zemit-artifact-notifications also emit the artifact typeJeremy Fitzhardinge-2/+4
This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
2019-05-07rustc: rename -Z emit-directives to -Z emit-artifact-notifications and ↵Eduard-Mihai Burtescu-6/+7
simplify the output.
2019-04-30In JSON output, emit a directive after metadata is generated.Nicholas Nethercote-2/+20
To implement pipelining, Cargo needs to know when metadata generation is finished. This commit adds code to do that. Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. The change involves splitting the existing `Emitter::emit` method in two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`. The JSON directives look like this: ``` {"directive":"metadata file written: liba.rmeta"} ``` The functionality is behind the `-Z emit-directives` option, and also requires `--error-format=json`.
2019-04-17Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddybMazdak Farrokhzad-11/+20
Emit ansi color codes in the `rendered` field of json diagnostics cc @ljedrz Implemented for https://github.com/rust-lang/rust/pull/56595#issuecomment-447645115 (x.py clippy)
2019-04-10Tweak unstable diagnostic outputEsteban Küber-13/+11
2019-04-02Rename `colorful-json` to `json-rendered` and make it a selection instead of ↵Oliver Scherer-9/+9
a bool
2019-04-02Emit ansi color codes in the `rendered` field of json diagnosticsOliver Scherer-10/+19
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-5/+6
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Cleanup importsTaiki Endo-1/+2
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-4/+4
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-07libsyntax => 2018Taiki Endo-8/+8
2019-01-13Cosmetic improvementsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-9/+9
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19mv filemap source_fileDonato Sciarra-2/+2
2018-08-19mv FileMap SourceFileDonato Sciarra-1/+1
2018-08-19mv CodeMap SourceMapDonato Sciarra-6/+6
2018-07-10Deny bare trait objects in in src/libsyntaxljedrz-3/+3
2018-05-21Stabilize suggestion applicability field in json outputManish Goregaokar-17/+4
2018-04-25Approximate -> ApplicabilityManish Goregaokar-13/+13
2018-04-24Use enum for approximate suggestionsManish Goregaokar-5/+5
2018-03-15Require the code mapper to be thread-safeJohn Kåre Alsaker-2/+2
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-5/+5
2018-02-26Support flag `-Z ui-testing` for tweaking diagnostic output for UI testsVadim Petrochenkov-1/+9
2018-02-01Auto merge of #47540 - Manishearth:suggestion, r=nrcbors-10/+30
Add approximate suggestions for rustfix This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "non-machine applicable" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-1/+1
2018-01-29Add internal-only rustc_serialize_exclude_null attribute for making the ↵Manish Goregaokar-0/+2
field only exist in the json if the flag is passed
2018-01-29Add -Zapproximate-suggestionsManish Goregaokar-4/+18
2018-01-29Add approximate suggestions for rustfixManish Goregaokar-7/+11
This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "approximate" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-1/+1
2017-11-20Address PR commentsOliver Schneider-1/+1
2017-11-20Include rendered diagnostic in jsonOliver Schneider-3/+25
2017-11-16Remove left over dead code from suggestion diagnostic refactoringOliver Schneider-12/+2
2017-11-09Auto merge of #45741 - oli-obk:refactor_suggestions, r=estebankbors-4/+4
Refactor internal suggestion API ~~The only functional change is that whitespace, which is suggested to be added, also gets `^^^^` under it. An example is shown in the tests (the only test that changed).~~ Continuation of #41876 r? @nagisa the changes are probably best viewed [without whitespace](https://github.com/rust-lang/rust/pull/45741/files?w=1)
2017-11-03Refactor internal suggestion APIOliver Schneider-4/+4
2017-11-03Pretty print json in ui testsOliver Schneider-6/+16
2017-11-03Remove outdated documentationOliver Schneider-6/+2