You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SwiftParser/SwiftParser.docc/FixingBugs.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Once you’ve written a test case (see below), set a breakpoint in `Parser.parse
10
10
11
11
1. Add a new test case in `SwiftParserTest` that looks like the following
12
12
```swift
13
-
AssertParse(
13
+
assertParse(
14
14
"""
15
15
<#your code that does not round trip#>
16
16
"""
@@ -27,7 +27,7 @@ Diagnostics are produced when the parsed syntax tree contains missing or unexpec
27
27
28
28
1. Add a test casein `SwiftParserTest` that looks like the following
29
29
```swift
30
-
AssertParse(
30
+
assertParse(
31
31
"""
32
32
<#your code that produces an invalid syntax tree#>
33
33
""",
@@ -54,7 +54,7 @@ To add a new, more contextual diagnostic, perform the following steps.
54
54
1. Add a test case in `SwiftParserTest` that looks like the following
55
55
56
56
```swift
57
-
AssertParse(
57
+
assertParse(
58
58
"""
59
59
<#your code that produced the unhelpful diagnostic#>
60
60
""",
@@ -69,7 +69,7 @@ To add a new, more contextual diagnostic, perform the following steps.
69
69
5. If the function does not already exist, write a new visit method on <doc:SwiftParser/ParseDiagnosticsGenerator>.
70
70
6. In that visitation method, detect the pattern for which the improved diagnostic should be emitted and emit it using `diagnostics.append`.
71
71
7. Mark the missing or garbage nodes that are covered by the new diagnostic as handled by adding their `SyntaxIdentifier`s to `handledNodes`.
72
-
8. If the diagnostic produces Fix-Its assert that they are generated by adding the Fix-It's message to the `DiagnosticSpec` with the `fixIt` parameter and asserting that applying the Fix-Its produces the correct source code by adding the `fixedSource` parameter to `AssertParse`.
72
+
8. If the diagnostic produces Fix-Its assert that they are generated by adding the Fix-It's message to the `DiagnosticSpec` with the `fixIt` parameter and asserting that applying the Fix-Its produces the correct source code by adding the `fixedSource` parameter to `assertParse`.
73
73
74
74
> 💡 Tip: To make typing the marker emojis more convienient. you can set up code snippets in Xcode. To do this, perform the following steps:
75
75
> 1. Type the marker in any Xcode window or find it in some test case
0 commit comments