File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -194,8 +194,22 @@ namespace {
194
194
bool maybePrintInsertionAfter (int Byte, raw_ostream &Out) {
195
195
for (auto fixIt : FixIts) {
196
196
if ((int )fixIt.EndByte - 1 == Byte) {
197
- Out.changeColor (ColoredStream::Colors::GREEN, true );
198
- Out << fixIt.Text ;
197
+ Out.changeColor (ColoredStream::Colors::GREEN, /* bold*/ true );
198
+ for (unsigned i = 0 ; i < fixIt.Text .size (); ++i) {
199
+ // Invert text colors for editor placeholders.
200
+ if (i + 1 < fixIt.Text .size () && fixIt.Text .substr (i, 2 ) == " <#" ) {
201
+ Out.changeColor (ColoredStream::Colors::GREEN, /* bold*/ true ,
202
+ /* background*/ true );
203
+ ++i;
204
+ } else if (i + 1 < fixIt.Text .size () &&
205
+ fixIt.Text .substr (i, 2 ) == " #>" ) {
206
+ Out.changeColor (ColoredStream::Colors::GREEN, /* bold*/ true ,
207
+ /* background*/ false );
208
+ ++i;
209
+ } else {
210
+ Out << fixIt.Text [i];
211
+ }
212
+ }
199
213
Out.resetColor ();
200
214
return true ;
201
215
}
Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ extension A {
34
34
35
35
let abc = " 👍
36
36
37
+ let x = {
38
+ let y = 1
39
+ return y
40
+ }
41
+
37
42
// Test fallback for non-ASCII characters.
38
43
// CHECK: SOURCE_DIR/test/diagnostics/pretty-printed-diagnostics.swift:35:11
39
44
// CHECK: 34 |
@@ -114,6 +119,11 @@ let abc = "👍
114
119
// CHECK: | ^ note: Remove '=' to make 'x' a computed property [remove '= '] [replace 'let' with 'var']
115
120
// CHECK: 33 | }
116
121
122
+ // CHECK: SOURCE_DIR/test/diagnostics/pretty-printed-diagnostics.swift:37:9
123
+ // CHECK: 36 |
124
+ // CHECK: 37 | let x = { () -> Result in
125
+ // CHECK: | ^ error: unable to infer complex closure return type; add explicit type to disambiguate
126
+ // CHECK: 38 | let y = 1
117
127
118
128
// CHECK: SOURCE_DIR/test/diagnostics/pretty-printed-diagnostics.swift:6:5
119
129
// CHECK: 5 | func foo(a: Int, b: Int) {
You can’t perform that action at this time.
0 commit comments