Commit 8a027bb
committed
[WIP] Hide empty snippets for full-file diagnostics
Summary
--
This isn't really polished for review yet, but this is the other commit I wanted
to spin off from #19415.
This suppresses empty snippets for empty ranges at the very beginning of a
file, and for empty ranges in non-existent files. Ruff includes empty ranges for
IO errors, for example.
Test Plan
--
TODO add a `ruff_db` test with an example1 parent 1e1bd62 commit 8a027bb
File tree
5 files changed
+47
-4
lines changed- crates
- ruff_annotate_snippets/src
- renderer
- ruff_db/src/diagnostic
- ruff_linter/src/message
5 files changed
+47
-4
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1164 | 1164 | | |
1165 | 1165 | | |
1166 | 1166 | | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1167 | 1177 | | |
1168 | 1178 | | |
1169 | 1179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
705 | 710 | | |
706 | 711 | | |
707 | 712 | | |
| |||
720 | 725 | | |
721 | 726 | | |
722 | 727 | | |
| 728 | + | |
723 | 729 | | |
724 | 730 | | |
725 | 731 | | |
| |||
736 | 742 | | |
737 | 743 | | |
738 | 744 | | |
| 745 | + | |
739 | 746 | | |
740 | 747 | | |
741 | 748 | | |
| |||
801 | 808 | | |
802 | 809 | | |
803 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
804 | 815 | | |
805 | 816 | | |
806 | 817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
| |||
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| 438 | + | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
| |||
651 | 653 | | |
652 | 654 | | |
653 | 655 | | |
| 656 | + | |
| 657 | + | |
654 | 658 | | |
655 | 659 | | |
656 | 660 | | |
| |||
668 | 672 | | |
669 | 673 | | |
670 | 674 | | |
| 675 | + | |
671 | 676 | | |
672 | 677 | | |
673 | 678 | | |
| |||
693 | 698 | | |
694 | 699 | | |
695 | 700 | | |
696 | | - | |
| 701 | + | |
697 | 702 | | |
698 | 703 | | |
699 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
| |||
0 commit comments