Skip to content

Commit 6ebf0d2

Browse files
committed
Add editor place holder pattern
1 parent dc908a6 commit 6ebf0d2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Tests/SwiftParserTest/PatternTests.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,29 @@ final class PatternTests: ParserTestCase {
168168
substructure: subscriptWithBindingPattern
169169
)
170170
}
171+
172+
func testPatternAsPlaceholderExpr() {
173+
assertParse(
174+
"let 1️⃣<#name#> = 2️⃣<#value#>",
175+
substructure: VariableDeclSyntax(
176+
bindingSpecifier: .keyword(.let),
177+
bindings: [
178+
PatternBindingSyntax(
179+
pattern: IdentifierPatternSyntax(
180+
identifier: .identifier("<#name#>")
181+
),
182+
initializer: InitializerClauseSyntax(
183+
value: EditorPlaceholderExprSyntax(
184+
placeholder: .identifier("<#value#>")
185+
)
186+
)
187+
)
188+
]
189+
),
190+
diagnostics: [
191+
DiagnosticSpec(locationMarker: "1️⃣", message: "editor placeholder in source file"),
192+
DiagnosticSpec(locationMarker: "2️⃣", message: "editor placeholder in source file"),
193+
]
194+
)
195+
}
171196
}

0 commit comments

Comments
 (0)