Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / third_party / rust / codespan-reporting / CHANGELOG.md
blob68109e06653fc98ce0cc5b62c7e109bbc0ecaceb
1 # Changelog
3 All notable changes to this project will be documented in this file.
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8 ## [Unreleased]
10 ## [0.11.1] - 2021-01-18
12 ### Added
14 -   Add `Chars::{box_drawing, ascii}` functions, the latter supporting a rustc-style of
15     output that only uses ASCII characters (not above U+007F) for use cases that do not allow
16     for box drawing characters, e.g. terminals that do not support them.
18 ### Changed
20 -   `Diagnostic::with_labels` and `Diagnostic::with_notes` now append additional
21     labels rather tan overwriting them, meaning that the documentation and behaviour match
22     more closely. The behaviour will only differ if you call the same builder methods
23     multiple times. If you call every builder method once only, nothing should change.
24 -   `config::Chars::snippet_start` is now a String instead of a single `char`.
26 ## [0.11.0] - 2020-11-30
28 There is now a [code of conduct](https://github.com/brendanzab/codespan/blob/master/CODE_OF_CONDUCT.md)
29 and a [contributing guide](https://github.com/brendanzab/codespan/blob/master/CONTRIBUTING.md).
31 Some versions were skipped to sync up with the `codespan-lsp` crate. The release
32 process has been changed so this should not happen again.
34 ### Added
36 -   If a label spans over multiple lines, not all lines are rendered.
37     The number of lines rendered at beginning and end is configurable separately.
38 -   There is now a custom error type.
39 -   There now is a medium rendering mode that is like the short rendering mode
40     but also shows notes from the diagnostic.
41 -   `PartialEq` and `Eq` implementations for the `diagnostic::{Diagnostic, Label, Severity}` types.
43 ### Changed
45 -   All errors now use the error type `codespan_reporting::file::Error`.
46     This type also replaces the custom error type for `codespan-lsp`.
48 ### Fixed
50 -   Empty error codes are not rendered.
51 -   The locus ("location of the diagnostic") is now computed so it is always at the first
52     primary label, or at the first secondary label if no primary labels are available.
53 -   All `unwrap`s outside of tests and examples have been removed.
54 -   Some internal improvements, including various code style improvements by using Clippy.
55 -   Improved documentation, also mentioning how the ordering of labels is handled.
57 ## [0.9.5] - 2020-06-24
59 ### Changed
61 -   Sections of source code that are marked with primary labels are now rendered
62     using the primary highlight color.
63 -   Tab stops are now rendered properly.
65     We used to just render `\t` characters in source snippets with the same
66     number of spaces.
68     <details>
69     <summary>Example</summary>
71     For example, when rendering with a tab width of `3` we
72     would print:
74     ```text
75     warning: tab test
76       ┌─ tab_columns:1:2
77       │
78     1 │    hello
79       │    ^^^^^
80     2 │ ∙   hello
81       │     ^^^^^
82     3 │ ∙∙   hello
83       │      ^^^^^
84     4 │ ∙∙∙   hello
85       │       ^^^^^
86     5 │ ∙∙∙∙   hello
87       │        ^^^^^
88     6 │ ∙∙∙∙∙   hello
89       │         ^^^^^
90     7 │ ∙∙∙∙∙∙   hello
91       │          ^^^^^
92     ```
94     Now we properly take into account the column of the tab character:
96     ```text
97     warning: tab test
98       ┌─ tab_columns:1:2
99       │
100     1 │    hello
101       │    ^^^^^
102     2 │ ∙  hello
103       │    ^^^^^
104     3 │ ∙∙ hello
105       │    ^^^^^
106     4 │ ∙∙∙   hello
107       │       ^^^^^
108     5 │ ∙∙∙∙  hello
109       │       ^^^^^
110     6 │ ∙∙∙∙∙ hello
111       │       ^^^^^
112     7 │ ∙∙∙∙∙∙   hello
113       │          ^^^^^
114     ```
116     </details>
118 ## [0.9.4] - 2020-05-18
120 ### Changed
122 -   We have made the caret rendering easier to read when there are multiple
123     labels on the same line. We also avoid printing trailing borders on the
124     final source source snippet if no notes are present.
126     <details>
127     <summary>Example</summary>
129     Instead of this:
131     ```text
132        ┌─ one_line.rs:3:5
133        │
134      3 │     v.push(v.pop().unwrap());
135        │     - first borrow later used by call
136        │       ---- first mutable borrow occurs here
137        │            ^ second mutable borrow occurs here
138        │
139     ```
141     …we now render the following:
143     ```text
144        ┌─ one_line.rs:3:5
145        │
146      3 │     v.push(v.pop().unwrap());
147        │     - ---- ^ second mutable borrow occurs here
148        │     │ │
149        │     │ first mutable borrow occurs here
150        │     first borrow later used by call
151     ```
153     </details>
155 ### Fixed
157 -   Diagnostic rendering no longer panics if label ranges are between UTF-8
158     character boundaries.
160 ## [0.9.3] - 2020-04-29
162 ### Changed
164 -   Some panics were fixed when invalid unicode boundaries are supplied.
165 -   Labels that marked the same span were originally rendered in reverse order.
166     This was a mistake! We've now fixed this.
168     <details>
169     <summary>Example</summary>
171     For example, this diagnostic:
173     ```text
174        ┌─ same_range:1:7
175        │
176      1 │ ::S { }
177        │     - Expected '('
178        │     ^ Unexpected '{'
179        │
180     ```
182     …will now be rendered as:
184     ```text
185        ┌─ same_range:1:7
186        │
187      1 │ ::S { }
188        │     ^ Unexpected '{'
189        │     - Expected '('
190        │
191     ```
193     </details>
195 -   We've reduced the prominence of the 'locus' on source snippets by
196     simplifying the border and reducing the spacing around it. This is to help
197     focus attention on the underlined source snippet and error messages, rather
198     than the location, which should be a secondary focus.
200     <details>
201     <summary>Example</summary>
203     For example we originally rendered this:
205     ```text
206     error: unknown builtin: `NATRAL`
208        ┌── Data/Nat.fun:7:13 ───
209        │
210      7 │ {-# BUILTIN NATRAL Nat #-}
211        │             ^^^^^^ unknown builtin
212        │
213        = there is a builtin with a similar name: `NATURAL`
215     ```
217     …and now we render this:
219     ```text
220     error: unknown builtin: `NATRAL`
221       ┌─ Data/Nat.fun:7:13
222       │
223     7 │ {-# BUILTIN NATRAL Nat #-}
224       │             ^^^^^^ unknown builtin
225       │
226       = there is a builtin with a similar name: `NATURAL`
228     ```
230     </details>
232 ## [0.9.2] - 2020-03-29
234 ### Changed
236 -   Render overlapping multiline marks on the same lines of source code.
238     <details>
239     <summary>Example</summary>
241     For example:
243     ```text
244     error[E0308]: match arms have incompatible types
246        ┌── codespan/src/file.rs:1:9 ───
247        │
248      1 │ ╭         match line_index.compare(self.last_line_index()) {
249      2 │ │             Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
250      3 │ │             Ordering::Equal => Ok(self.source_span().end()),
251      4 │ │             Ordering::Greater => LineIndexOutOfBoundsError {
252      5 │ │                 given: line_index,
253      6 │ │                 max: self.last_line_index(),
254      7 │ │             },
255      8 │ │         }
256        │ ╰─────────' `match` arms have incompatible types
257        ·
258      2 │               Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
259        │                                 --------------------------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
260      3 │               Ordering::Equal => Ok(self.source_span().end()),
261        │                                  ---------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
262      4 │               Ordering::Greater => LineIndexOutOfBoundsError {
263        │ ╭──────────────────────────────────^
264      5 │ │                 given: line_index,
265      6 │ │                 max: self.last_line_index(),
266      7 │ │             },
267        │ ╰─────────────^ expected enum `Result`, found struct `LineIndexOutOfBoundsError`
268        │
269        = expected type `Result<ByteIndex, LineIndexOutOfBoundsError>`
270             found type `LineIndexOutOfBoundsError`
271     ```
273     …is now rendered as:
275     ```text
276     error[E0308]: match arms have incompatible types
278        ┌── codespan/src/file.rs:1:9 ───
279        │
280      1 │   ╭         match line_index.compare(self.last_line_index()) {
281      2 │   │             Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
282        │   │                               --------------------------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
283      3 │   │             Ordering::Equal => Ok(self.source_span().end()),
284        │   │                                ---------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
285      4 │   │             Ordering::Greater => LineIndexOutOfBoundsError {
286        │ ╭─│──────────────────────────────────^
287      5 │ │ │                 given: line_index,
288      6 │ │ │                 max: self.last_line_index(),
289      7 │ │ │             },
290        │ ╰─│─────────────^ expected enum `Result`, found struct `LineIndexOutOfBoundsError`
291      8 │   │         }
292        │   ╰─────────' `match` arms have incompatible types
293        │
294        = expected type `Result<ByteIndex, LineIndexOutOfBoundsError>`
295             found type `LineIndexOutOfBoundsError`
296     ```
298     </details>
300 ## [0.9.1] - 2020-03-23
302 ### Added
304 -   `codespan_reporting::diagnostic::Diagnostic` now implements `Debug`.
306 ### Changed
308 -   Single-line labels are now rendered together, under the same source line.
310     <details>
311     <summary>Example</summary>
313     For example:
315     ```text
316        ┌── one_line.rs:3:5 ───
317        │
318      3 │     v.push(v.pop().unwrap());
319        │     - first borrow later used by call
320        ·
321      3 │     v.push(v.pop().unwrap());
322        │       ---- first mutable borrow occurs here
323        ·
324      3 │     v.push(v.pop().unwrap());
325        │            ^ second mutable borrow occurs here
326        │
327     ```
329     …is now rendered as:
331     ```text
332        ┌── one_line.rs:3:5 ───
333        │
334      3 │     v.push(v.pop().unwrap());
335        │     - first borrow later used by call
336        │       ---- first mutable borrow occurs here
337        │            ^ second mutable borrow occurs here
338        │
339     ```
341     </details>
343 ## [0.9.0] - 2020-03-11
345 ### Added
347 -   The `codespan_reporting::files` module was added as a way to decouple
348     `codespan_reporting` from `codespan`.
349     -   `codespan_reporting::files::Files` allows users to implement custom file
350         databases that work with `codespan_reporting`. This should make it
351         easier to integrate with libraries like Salsa, and also makes it less
352         invasive to use `codespan_reporting` on existing projects.
353     -   `codespan_reporting::files::SimpleFile` is a simple implementation of
354         `codespan_reporting::files::Files` where only a single file is needed.
355     -   `codespan_reporting::files::SimpleFiles` is a simple implementation of
356         `codespan_reporting::files::Files` where multiple files are needed.
358 ### Changed
360 -   The `codespan_reporting::diagnostic` module has been greatly revamped,
361     making the builder API format more nicely with rustfmt, and allowing for
362     multiple primary labels.
363 -   The output of `codespan_reporting::term::emit` was improved,
364     with the following changes:
365     -   labels on consecutive lines no longer render breaks between them
366     -   source lines are rendered when there is only one line between labels
367     -   the inner gutter of code snippets is now aligned consistently
368     -   the outer gutter of consecutive code snippets are now aligned consistently
369 -   `codespan_reporting::term::emit` now takes writers as a trait object (rather
370     than using static dispatch) in order to reduce coda bloat and improve
371     compile times.
372 -   The field names in `codespan_reporting::term::Chars` were tweaked for
373     consistency.
375 ### Removed
377 -   `codespan_reporting` no longer depends on `codespan`.
378     Note that `codespan` can _still_ be used with `codespan_reporting`,
379     as `codespan::Files` now implements `codespan_reporting::files::Files`.
381 ## [0.8.0] - 2020-02-24
382 ## [0.7.0] - 2020-01-06
383 ## [0.6.0] - 2019-12-18
384 ## [0.5.0] - 2019-10-02
385 ## [0.4.1] - 2019-08-25
386 ## [0.4.0] - 2019-08-22
387 ## [0.3.0] - 2019-05-01
388 ## [0.2.1] - 2019-02-26
389 ## [0.2.0] - 2018-10-11
391 [Unreleased]: https://github.com/brendanzab/codespan/compare/v0.11.1...HEAD
392 [0.11.1]: https://github.com/brendanzab/codespan/compare/v0.11.0..v0.11.1
393 [0.11.0]: https://github.com/brendanzab/codespan/compare/v0.9.5...v0.11.0
394 [0.9.5]: https://github.com/brendanzab/codespan/compare/v0.9.4...v0.9.5
395 [0.9.4]: https://github.com/brendanzab/codespan/compare/v0.9.3...v0.9.4
396 [0.9.3]: https://github.com/brendanzab/codespan/compare/v0.9.2...v0.9.3
397 [0.9.2]: https://github.com/brendanzab/codespan/compare/v0.9.1...v0.9.2
398 [0.9.1]: https://github.com/brendanzab/codespan/compare/v0.9.0...v0.9.1
399 [0.9.0]: https://github.com/brendanzab/codespan/compare/v0.8.0...v0.9.0
400 [0.8.0]: https://github.com/brendanzab/codespan/compare/v0.7.0...v0.8.0
401 [0.7.0]: https://github.com/brendanzab/codespan/compare/v0.6.0...v0.7.0
402 [0.6.0]: https://github.com/brendanzab/codespan/compare/v0.5.0...v0.6.0
403 [0.5.0]: https://github.com/brendanzab/codespan/compare/v0.4.1...v0.5.0
404 [0.4.1]: https://github.com/brendanzab/codespan/compare/v0.4.0...v0.4.1
405 [0.4.0]: https://github.com/brendanzab/codespan/compare/v0.3.0...v0.4.0
406 [0.3.0]: https://github.com/brendanzab/codespan/compare/v0.2.1...v0.3.0
407 [0.2.1]: https://github.com/brendanzab/codespan/compare/v0.2.0...v0.2.1
408 [0.2.0]: https://github.com/brendanzab/codespan/releases/tag/v0.2.0