You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a new API for overriding the use of `...` to indicate a cut or
trimmed line. In the case of Ruff, we didn't want to use `...` since
`...` is valid Python code. It could be rather confusing in some cases
where `...` would be ambiguous between "line was cut here" and "this is
what the actual line read as." I think this can happen with _any_
indicator of course, but for Python specifically, it's pretty likely to
happen with `...`.
The new API here is somewhat sub-optimal in that it requires a
`&'static str`. I did this because of the constraints imposed by
a `Renderer`'s `const` constructor.
let body = format_message(message, term_width, anonymized_line_numbers,true);
127
+
let body = format_message(
128
+
message,
129
+
term_width,
130
+
anonymized_line_numbers,
131
+
cut_indicator,
132
+
true,
133
+
);
124
134
125
135
Self{
126
136
body,
127
137
stylesheet,
128
138
anonymized_line_numbers,
139
+
cut_indicator,
129
140
}
130
141
}
131
142
@@ -143,6 +154,7 @@ impl<'a> DisplayList<'a> {
143
154
multiline_depth,
144
155
self.stylesheet,
145
156
self.anonymized_line_numbers,
157
+
self.cut_indicator,
146
158
buffer,
147
159
)?;
148
160
}
@@ -270,6 +282,7 @@ impl DisplaySet<'_> {
270
282
}
271
283
272
284
// Adapted from https://github.com/rust-lang/rust/blob/d371d17496f2ce3a56da76aa083f4ef157572c20/compiler/rustc_errors/src/emitter.rs#L706-L1211
0 commit comments