File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -93,18 +93,27 @@ fn main() -> anyhow::Result<()> {
93
93
let ( doc, source) = load_file ( & file) ?;
94
94
95
95
let primary_color = Color :: Blue ;
96
+ let secondary_color = Color :: Magenta ;
96
97
let filename = file
97
98
. file_name ( )
98
99
. map ( |s| s. to_string_lossy ( ) . into ( ) )
99
100
. unwrap_or ( "<file>" . to_string ( ) ) ;
100
101
101
102
let mut report_builder = Report :: build ( ReportKind :: Advice , & filename, 0 ) ;
103
+ let mut color = primary_color;
102
104
for token in doc. tokens ( ) {
103
105
report_builder = report_builder. with_label (
104
106
Label :: new ( ( & filename, token. span . into ( ) ) )
105
107
. with_message ( format ! ( "[{}, {})" , token. span. start, token. span. end) )
106
- . with_color ( primary_color ) ,
108
+ . with_color ( color ) ,
107
109
) ;
110
+
111
+ // Alternate colors so spans are clear
112
+ color = if color == primary_color {
113
+ secondary_color
114
+ } else {
115
+ primary_color
116
+ } ;
108
117
}
109
118
110
119
let report = report_builder. finish ( ) ;
You can’t perform that action at this time.
0 commit comments