Skip to content

Commit 823eeec

Browse files
author
Nathan Hawes
committed
Revert "[SyntaxColor] Improve highligting of multiline strings"
This reverts commit 86d0fc3. This was causing a performance regression. Resolves rdar://problem/32434045
1 parent f16c00a commit 823eeec

File tree

9 files changed

+83
-437
lines changed

9 files changed

+83
-437
lines changed

include/swift/IDE/Formatting.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ class LineRange {
8181
else if (Line >= StartLine + Length) {
8282
Length = Line - StartLine + 1;
8383
}
84-
else if (Line < StartLine) {
85-
unsigned Delta = StartLine - Line;
86-
StartLine -= Delta;
87-
Length += Delta;
88-
}
8984
}
9085

9186
};

lib/IDE/SyntaxModel.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,6 @@ SyntaxModelContext::SyntaxModelContext(SourceFile &SrcFile)
206206
break;
207207
}
208208

209-
case tok::unknown:
210-
if (Tok.getText().startswith("\"")) {
211-
// invalid string literal
212-
Kind = SyntaxNodeKind::String;
213-
break;
214-
}
215-
continue;
216209
default:
217210
continue;
218211
}

test/IDE/coloring.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,6 @@ func f(x: Int) -> Int {
227227
// CHECK: <str>"This is string </str>\<anchor>(</anchor>genFn({(a:<type>Int</type> -> <type>Int</type>) <kw>in</kw> a})<anchor>)</anchor><str> interpolation"</str>
228228
"This is string \(genFn({(a:Int -> Int) in a})) interpolation"
229229

230-
// CHECK: <str>"This is unterminated</str>
231-
"This is unterminated
232-
233-
// CHECK: <str>"This in unterminated with ignored \( "interpolation" ) in it</str>
234-
"This in unterminated with ignored \( "interpolation" ) in it
235-
236-
// CHECK: <str>"This is terminated with \( invalid interpolation" + "in it"</str>
237-
"This is terminated with \( invalid interpolation" + "in it"
238-
239230
// CHECK: <str>"""
240231
// CHECK-NEXT: This is a multiline string.
241232
// CHECK-NEXT: """</str>
@@ -245,15 +236,9 @@ func f(x: Int) -> Int {
245236

246237
// CHECK: <str>"""
247238
// CHECK-NEXT: This is a multiline</str>\<anchor>(</anchor> <str>"interpolated"</str> <anchor>)</anchor><str>string
248-
// CHECK-NEXT: </str>\<anchor>(</anchor>
249-
// CHECK-NEXT: <str>"inner"</str>
250-
// CHECK-NEXT: <anchor>)</anchor><str>
251239
// CHECK-NEXT: """</str>
252240
"""
253241
This is a multiline\( "interpolated" )string
254-
\(
255-
"inner"
256-
)
257242
"""
258243
}
259244

test/IDE/coloring_unterminated_multiline.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/SourceKit/SyntaxMapData/Inputs/syntaxmap-edit-block-comment.swift

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/SourceKit/SyntaxMapData/Inputs/syntaxmap-edit-multiline-string.swift

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/SourceKit/SyntaxMapData/syntaxmap-edit-block-comment.swift

Lines changed: 0 additions & 69 deletions
This file was deleted.

test/SourceKit/SyntaxMapData/syntaxmap-edit-multiline-string.swift

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)