Skip to content

Commit b9eabad

Browse files
authored
Revert "[4.0] Fix multi-line string syntax coloring issues" (#10634) (#10653)
1 parent c09a095 commit b9eabad

21 files changed

+229
-1352
lines changed

lib/IDE/SyntaxModel.cpp

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

209-
case tok::unknown: {
210-
if (Tok.getRawText().startswith("\"")) {
211-
// This is an invalid string literal
212-
Kind = SyntaxNodeKind::String;
213-
break;
214-
}
215-
continue;
216-
}
217-
218209
default:
219210
continue;
220211
}

test/IDE/coloring.swift

Lines changed: 0 additions & 19 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 is unterminated with ignored \(interpolation) in it</str>
234-
"This is 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,19 +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>"""
250-
// CHECK-NEXT: inner
251-
// CHECK-NEXT: """</str>
252-
// CHECK-NEXT: <anchor>)</anchor><str>
253239
// CHECK-NEXT: """</str>
254240
"""
255241
This is a multiline\( "interpolated" )string
256-
\(
257-
"""
258-
inner
259-
"""
260-
)
261242
"""
262243
}
263244

test/IDE/unterminated_multiline.swift

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

test/SourceKit/DocumentStructure/mark_edit.swift.response

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
]
1414
}
1515
{
16+
key.offset: 0,
17+
key.length: 3,
1618
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
1719
key.substructure: [
1820
{

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

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

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

Lines changed: 0 additions & 5 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/Inputs/syntaxmap-edit-nested-token.swift

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

test/SourceKit/SyntaxMapData/Inputs/syntaxmap-edit-remove.swift

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

test/SourceKit/SyntaxMapData/Inputs/syntaxmap-multiple-edits.swift

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

test/SourceKit/SyntaxMapData/Inputs/syntaxmap-partial-delete.swift

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

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

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

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

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

test/SourceKit/SyntaxMapData/syntaxmap-edit-del.swift.response

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
{
3131
key.offset: 1,
32-
key.length: 34,
32+
key.length: 36,
3333
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
3434
key.syntaxmap: [
3535
{

test/SourceKit/SyntaxMapData/syntaxmap-edit-del.swift.response2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
]
2929
}
3030
{
31+
key.offset: 36,
32+
key.length: 0,
3133
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
3234
key.syntaxmap: [
3335
]

0 commit comments

Comments
 (0)