Skip to content

Commit c2c7980

Browse files
authored
Merge pull request #2826 from TTOzzi/fix-removeBackslash-message
Fix removeBackslash message to display backslash correctly
2 parents e674d66 + dd9c4b7 commit c2c7980

File tree

3 files changed

+12
-33
lines changed

3 files changed

+12
-33
lines changed

Sources/SwiftParserDiagnostics/ParserDiagnosticMessages.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ extension FixItMessage where Self == StaticParserFixIt {
671671
.init("join the identifiers together with camel-case")
672672
}
673673
public static var removeBackslash: Self {
674-
.init("remove '\'")
674+
.init(#"remove '\'"#)
675675
}
676676
public static var removeExtraneousDelimiters: Self {
677677
.init("remove extraneous delimiters")

Tests/SwiftParserTest/ExpressionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ final class ExpressionTests: ParserTestCase {
13241324
diagnostics: [
13251325
DiagnosticSpec(
13261326
message: "escaped newline at the last line of a multi-line string literal is not allowed",
1327-
fixIts: ["remove ''"]
1327+
fixIts: [#"remove '\'"#]
13281328
)
13291329
],
13301330
fixedSource: #"""

Tests/SwiftParserTest/translated/MultilineErrorsTests.swift

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ final class MultilineErrorsTests: ParserTestCase {
634634
diagnostics: [
635635
DiagnosticSpec(
636636
message: "escaped newline at the last line of a multi-line string literal is not allowed",
637-
fixIts: ["remove '\'"]
637+
fixIts: [#"remove '\'"#]
638638
)
639639
],
640640
fixedSource: #"""
@@ -656,7 +656,7 @@ final class MultilineErrorsTests: ParserTestCase {
656656
diagnostics: [
657657
DiagnosticSpec(
658658
message: "escaped newline at the last line of a multi-line string literal is not allowed",
659-
fixIts: ["remove ''"]
659+
fixIts: [#"remove '\'"#]
660660
)
661661
],
662662
fixedSource: #"""
@@ -677,7 +677,7 @@ final class MultilineErrorsTests: ParserTestCase {
677677
diagnostics: [
678678
DiagnosticSpec(
679679
message: "escaped newline at the last line of a multi-line string literal is not allowed",
680-
fixIts: ["remove ''"]
680+
fixIts: [#"remove '\'"#]
681681
)
682682
],
683683
fixedSource: #"""
@@ -698,7 +698,7 @@ final class MultilineErrorsTests: ParserTestCase {
698698
diagnostics: [
699699
DiagnosticSpec(
700700
message: "escaped newline at the last line of a multi-line string literal is not allowed",
701-
fixIts: ["remove ''"]
701+
fixIts: [#"remove '\'"#]
702702
)
703703
],
704704
fixedSource: #"""
@@ -710,27 +710,6 @@ final class MultilineErrorsTests: ParserTestCase {
710710
}
711711

712712
func testMultilineErrors25() {
713-
assertParseWithAllNewlineEndings(
714-
#"""
715-
_ = """
716-
foo1️⃣\
717-
"""
718-
"""#,
719-
diagnostics: [
720-
DiagnosticSpec(
721-
message: "escaped newline at the last line of a multi-line string literal is not allowed",
722-
fixIts: ["remove ''"]
723-
)
724-
],
725-
fixedSource: #"""
726-
_ = """
727-
foo
728-
"""
729-
"""#
730-
)
731-
}
732-
733-
func testMultilineErrors26() {
734713
assertParseWithAllNewlineEndings(
735714
##"""
736715
_ = ℹ️"""
@@ -756,7 +735,7 @@ final class MultilineErrorsTests: ParserTestCase {
756735
)
757736
}
758737

759-
func testMultilineErrors28() {
738+
func testMultilineErrors26() {
760739
assertParseWithAllNewlineEndings(
761740
#"""
762741
_ = """
@@ -766,7 +745,7 @@ final class MultilineErrorsTests: ParserTestCase {
766745
diagnostics: [
767746
DiagnosticSpec(
768747
message: "escaped newline at the last line of a multi-line string literal is not allowed",
769-
fixIts: ["remove ''"]
748+
fixIts: [#"remove '\'"#]
770749
)
771750
],
772751
fixedSource: #"""
@@ -777,7 +756,7 @@ final class MultilineErrorsTests: ParserTestCase {
777756
)
778757
}
779758

780-
func testMultilineErrors29() {
759+
func testMultilineErrors27() {
781760
assertParseWithAllNewlineEndings(
782761
#"""
783762
_ = """1️⃣\
@@ -790,7 +769,7 @@ final class MultilineErrorsTests: ParserTestCase {
790769
),
791770
DiagnosticSpec(
792771
message: "escaped newline at the last line of a multi-line string literal is not allowed",
793-
fixIts: ["remove ''"]
772+
fixIts: [#"remove '\'"#]
794773
),
795774
],
796775
fixedSource: #"""
@@ -802,7 +781,7 @@ final class MultilineErrorsTests: ParserTestCase {
802781
)
803782
}
804783

805-
func testMultilineErrors30() {
784+
func testMultilineErrors28() {
806785
assertParseWithAllNewlineEndings(
807786
##"""
808787
let _ = """
@@ -839,7 +818,7 @@ final class MultilineErrorsTests: ParserTestCase {
839818
)
840819
}
841820

842-
func testMultilineErrors31() {
821+
func testMultilineErrors29() {
843822
assertParseWithAllNewlineEndings(
844823
##"""
845824
let _ = """

0 commit comments

Comments
 (0)