Skip to content

Commit 3c123b6

Browse files
authored
Merge pull request #33914 from amcasey/ConflictMarker
Handle string literals in merge conflict regions
2 parents 6104f74 + 87c905f commit 3c123b6

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/services/classifier.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,7 @@ namespace ts {
985985
return ClassificationType.bigintLiteral;
986986
}
987987
else if (tokenKind === SyntaxKind.StringLiteral) {
988-
// TODO: GH#18217
989-
return token!.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral;
988+
return token && token.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral;
990989
}
991990
else if (tokenKind === SyntaxKind.RegularExpressionLiteral) {
992991
// TODO: we should get another classification type for these literals.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="fourslash.ts"/>
2+
3+
//// <<<<<<< HEAD
4+
//// "AAAA"
5+
//// =======
6+
//// "BBBB"
7+
//// >>>>>>> Feature
8+
9+
10+
var c = classification;
11+
verify.syntacticClassificationsAre(
12+
c.comment("<<<<<<< HEAD"),
13+
c.stringLiteral("\"AAAA\""),
14+
c.comment("======="),
15+
c.stringLiteral("\"BBBB\""),
16+
c.comment(">>>>>>> Feature"));

0 commit comments

Comments
 (0)