File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -168,4 +168,29 @@ final class PatternTests: ParserTestCase {
168
168
substructure: subscriptWithBindingPattern
169
169
)
170
170
}
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
+ }
171
196
}
You can’t perform that action at this time.
0 commit comments