|
15 | 15 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_REQUIRED_NEWLINE_3 | %FileCheck %s -check-prefix=INIT_REQUIRED_NEWLINE_3
|
16 | 16 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FALLBACK_1 | %FileCheck %s -check-prefix=INIT_FALLBACK
|
17 | 17 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FALLBACK_2 | %FileCheck %s -check-prefix=INIT_FALLBACK
|
| 18 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBERDECL_SAMELINE | %FileCheck %s -check-prefix=MEMBERDECL_SAMELINE |
| 19 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBERDECL_NEWLINE | %FileCheck %s -check-prefix=MEMBERDECL_NEWLINE |
18 | 20 |
|
19 | 21 | func globalFunc1(fn1: () -> Int, fn2: () -> String) {}
|
20 | 22 | func testGlobalFunc() {
|
@@ -207,3 +209,28 @@ func testFallbackPostfix() {
|
207 | 209 | 1
|
208 | 210 | } #^INIT_FALLBACK_2^#
|
209 | 211 | }
|
| 212 | + |
| 213 | +protocol P { |
| 214 | + func foo() |
| 215 | +} |
| 216 | +struct TestNominalMember: P { |
| 217 | + var value = MyStruct().method1 { 1 } #^MEMBERDECL_SAMELINE^# |
| 218 | + #^MEMBERDECL_NEWLINE^# |
| 219 | + |
| 220 | +// MEMBERDECL_SAMELINE: Begin completions, 4 items |
| 221 | +// MEMBERDECL_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: (() -> String)? {() -> String in|}#}[#(() -> String)?#]; name=fn2: (() -> String)? |
| 222 | +// MEMBERDECL_SAMELINE-DAG: Decl[InstanceMethod]/CurrNominal: .enumFunc()[#Void#]; name=enumFunc() |
| 223 | +// MEMBERDECL_SAMELINE-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]/IsSystem: [' ']+ {#SimpleEnum#}[#SimpleEnum#]; name=+ SimpleEnum |
| 224 | +// MEMBERDECL_SAMELINE-DAG: Keyword[self]/CurrNominal: .self[#SimpleEnum#]; name=self |
| 225 | +// MEMBERDECL_SAMELINE: End completions |
| 226 | + |
| 227 | +// MEMBERDECL_NEWLINE: Begin completions |
| 228 | +// MEMBERDECL_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: (() -> String)? {() -> String in|}#}[#(() -> String)?#]; name=fn2: (() -> String)? |
| 229 | +// MEMBERDECL_NEWLINE-DAG: Keyword[enum]/None: enum; name=enum |
| 230 | +// MEMBERDECL_NEWLINE-DAG: Keyword[func]/None: func; name=func |
| 231 | +// MEMBERDECL_NEWLINE-DAG: Keyword[private]/None: private; name=private |
| 232 | +// MEMBERDECL_NEWLINE-DAG: Keyword/None: lazy; name=lazy |
| 233 | +// MEMBERDECL_NEWLINE-DAG: Keyword[var]/None: var; name=var |
| 234 | +// MEMBERDECL_NEWLINE-DAG: Decl[InstanceMethod]/Super: func foo() {|}; name=foo() |
| 235 | +// MEMBERDECL_NEWLINE: End completions |
| 236 | +} |
0 commit comments