File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -3525,8 +3525,14 @@ Parser::parseExprCollectionElement(Optional<bool> &isDictionary) {
3525
3525
// Parse the value.
3526
3526
auto Value = parseExpr (diag::expected_value_in_dictionary_literal);
3527
3527
3528
- if (Value.isNull ())
3529
- Value = makeParserResult (Value, new (Context) ErrorExpr (PreviousLoc));
3528
+ if (Value.isNull ()) {
3529
+ if (!Element.hasCodeCompletion ()) {
3530
+ Value = makeParserResult (Value, new (Context) ErrorExpr (PreviousLoc));
3531
+ } else {
3532
+ Value = makeParserResult (Value,
3533
+ new (Context) CodeCompletionExpr (PreviousLoc));
3534
+ }
3535
+ }
3530
3536
3531
3537
// Make a tuple of Key Value pair.
3532
3538
return makeParserResult (
Original file line number Diff line number Diff line change 64
64
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_5 | %FileCheck %s -check-prefix=IN_FOR_EACH_1
65
65
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_6 | %FileCheck %s -check-prefix=IN_FOR_EACH_2
66
66
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_7 | %FileCheck %s -check-prefix=IN_FOR_EACH_1
67
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_8 | %FileCheck %s -check-prefix=IN_FOR_EACH_1
67
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_8 | %FileCheck %s -check-prefix=IN_FOR_EACH_4
68
68
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_9 | %FileCheck %s -check-prefix=IN_FOR_EACH_4
69
69
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_10 | %FileCheck %s -check-prefix=IN_FOR_EACH_1
70
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_11 | %FileCheck %s -check-prefix=IN_FOR_EACH_1
70
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_11 | %FileCheck %s -check-prefix=IN_FOR_EACH_2
71
71
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_FOR_EACH_12 | %FileCheck %s -check-prefix=IN_FOR_EACH_2
72
72
73
73
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEPRECATED_1 | %FileCheck %s -check-prefix=DEPRECATED_1
Original file line number Diff line number Diff line change 51
51
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_40 | %FileCheck %s -check-prefix=UNRESOLVED_3
52
52
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_41 | %FileCheck %s -check-prefix=UNRESOLVED_3
53
53
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_42 | %FileCheck %s -check-prefix=UNRESOLVED_3
54
- // RUN-FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_43 | %FileCheck %s -check-prefix=UNRESOLVED_3
54
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_43 | %FileCheck %s -check-prefix=UNRESOLVED_3
55
+ // RUN-FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_44 | %FileCheck %s -check-prefix=UNRESOLVED_3
55
56
56
57
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ENUM_AVAIL_1 | %FileCheck %s -check-prefix=ENUM_AVAIL_1
57
58
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OPTIONS_AVAIL_1 | %FileCheck %s -check-prefix=OPTIONS_AVAIL_1
@@ -397,7 +398,8 @@ let _: [SomeEnum1:SomeOptions1] = [.#^UNRESOLVED_39^#]
397
398
let _: [ SomeEnum1 : SomeOptions1 ] = [ . #^UNRESOLVED_40 ^#: ]
398
399
let _: [ SomeEnum1 : SomeEnum3 ] = [ . South: . Payload( . South) , . South: . Payload( . #^UNRESOLVED_41 ^#) ]
399
400
let _: [ SomeEnum3 : SomeEnum1 ] = [ . Payload( . South) : . South, . Payload( . #^UNRESOLVED_42 ^#) : . South]
400
- let _: [ SomeEnum3 : SomeEnum1 ] = [ . Payload( . South) : . South, . Payload( . #^UNRESOLVED_43 ^#) ]
401
+ let _: [ SomeEnum3 : SomeEnum1 ] = [ . Payload( . South) : . South, . Payload( . #^UNRESOLVED_43 ^#) : ]
402
+ let _: [ SomeEnum3 : SomeEnum1 ] = [ . Payload( . South) : . South, . Payload( . #^UNRESOLVED_44 ^#) ]
401
403
402
404
func testAvail1 ( _ x: EnumAvail1) {
403
405
testAvail1 ( . #^ENUM_AVAIL_1 ^#)
You can’t perform that action at this time.
0 commit comments