Uh oh!
There was an error while loading. Please reload this page.
Reduce visual clutter of multiline start when possible - #41245
Conversation
estebank
commented
Apr 12, 2017
nikomatsakis
commented
Apr 12, 2017
Seems better. I would still like to make progress on only highlighting the struct name etc, though I know that's a deeper edit. |
nikomatsakis
commented
Apr 12, 2017
I wonder if the |
estebank
commented
Apr 12, 2017
#41214 is an attempt at doing the smallest patch possible that would accomplish that.
Would it make sense to remove the |
sophiajt
commented
Apr 12, 2017
@nikomatsakis - seconded on "can we underline just the name". I feel like often, but not always, that's what we want to do. |
4586517 to
f52e1dfComparenikomatsakis
commented
Apr 13, 2017
I've wondered the same. I think quite likely yes. |
Mark-Simulacrum
commented
Apr 14, 2017
Looks like tests need to be fixed here. |
nikomatsakis
commented
Apr 14, 2017
@estebank I like it. One thing I've also wondered: would it be hard to put the label text at the top rather than the bottom? I usually find that a bit more intuitive. |
@nikomatsakis it wouldn't be hard to do it, but I've been thinking about doing the following 2 | fn foo(){{
| ____^ -
| | ___________|
| ||
3 | ||
4 | || }}
| ||__- ^
| |_____|instead of 2 | fn foo(){{
| ___^_______-
| |___|
| ||
3 | ||
4 | || }}
| || - ^
| ||__|_|
| |__|which wouldn't work with labels (regardless of on top or the bottom). (Then again, it doesn't work with them in the bottom with that change either.) I'll add the change to do move the labels on the top to this PR. |
e096cfa to
cbbe6a6Compareestebank
commented
Apr 15, 2017
Also just realized, while moving the labels to the beginning, this PR's change is unworkable, as the you need the line for the label after the first line of the span to be able to show the text. Keeping it in the end, either always or only when the multiline span is the only thing being shown, would be necessary to decrease the vertical space waste. |
44f36f0 to
b6da758Comparenikomatsakis
commented
Apr 17, 2017
Oh, hmm, good point! You could preserve the total number of lines like so: But I imagine that part of the point here is also just not to interject stuff into the middle. |
nikomatsakis
commented
Apr 18, 2017
@estebank ok well let's leave labels at the end for now. PR seems good to me. Did you plan to make more changes? |
estebank
commented
Apr 18, 2017
@nikomatsakis I just need to clean up the last commit. Shall we merge this with the removal of the |
nikomatsakis
commented
Apr 19, 2017
👍 from me |
6639fd0 to
152a74cComparenikomatsakis
commented
Apr 20, 2017
👍 |
@nikomatsakis, I'll r=you once I've fixed the current output discrepancy: [00:58:15] expected output:[00:58:15] ------
[00:58:15] error: foo
[00:58:15] --> test.rs:3:3[00:58:15] |
[00:58:15]3 | X0Y0[00:58:15] | ____^__-
[00:58:15] | | ___|
[00:58:15]4 | || Y1X1[00:58:15] | ||____-__^ `X` is a good letter
[00:58:15] | |_____|
[00:58:15] | `Y` is a good letter too
[00:58:15][00:58:15] ------
[00:58:15] actual output:[00:58:15] ------
[00:58:15] error: foo
[00:58:15] --> test.rs:3:3[00:58:15] |
[00:58:15]3 | X0Y0[00:58:15] | ____^__-
[00:58:15]4 | || Y1X1[00:58:15] | ||____-__^ `X` is a good letter
[00:58:15] | |_____|
[00:58:15] | `Y` is a good letter tooIs there a way to run only these tests using Also, I'll have to rebase to fix tests that have changed since I created this PR. |
8f5afc7 to
0ca2234Comparenikomatsakis
commented
Apr 20, 2017
@estebank what test is it? A useful option is will put you into a shell with all the environment and stuff setup. It'll print the last command (which failed). So you can copy-and-paste that command and then re-run to your heart's content. |
estebank
commented
Apr 20, 2017
@nikomatsakis it's |
4c79c51 to
b13eb7cCompareWhen a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.
Go from:
```rust
error[E0072]: recursive type `A` has infinite size
--> file2.rs:1:1
|
1 | struct A {
| _^ starting here...
2 | | a: A,
3 | | }
| |_^ ...ending here: recursive type has infinite size
|
```
To:
```rust
error[E0072]: recursive type `A` has infinite size
--> file2.rs:1:1
|
1 | / struct A {
2 | | a: A,
3 | | }
| |_^ recursive type has infinite size
```
Remove `starting here...`/`...ending here` labels from all multiline
diagnostics.estebank
commented
Apr 21, 2017
@bors r=nikomatsakis |
bors
commented
Apr 21, 2017
📌 Commit cc07c35 has been approved by |
bors
commented
Apr 21, 2017
Reduce visual clutter of multiline start when possible
When a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.
Go from:
```rust
error[E0072]: recursive type `A` has infinite size
--> file2.rs:1:1
|
1 | struct A {
| _^ starting here...
2 | | a: A,
3 | | }
| |_^ ...ending here: recursive type has infinite size
|
```
To:
```rust
error[E0072]: recursive type `A` has infinite size
--> file2.rs:1:1
|
1 | / struct A {
2 | | a: A,
3 | | }
| |_^ recursive type has infinite size
```
Re: #38246.
r? @nikomatsakis CC @jonathandturnerbors
commented
Apr 21, 2017
☀️ Test successful - status-appveyor, status-travis |


When a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.
Go from:
To:
Re: #38246.
r? @nikomatsakis CC @jonathandturner