Skip to content

Commit 2ef514e

Browse files
committed
Revert "[CodeCompletion] Don't complete .members after a space"
It was pointed out to me that this syntax is legal (d'oh). Maybe we should delete the extra spaces when we insert the ".", but otherwise this is working as-is. This reverts commit 1878be2.
1 parent 3277c91 commit 2ef514e

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,9 +2654,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
26542654
if (HaveLParen)
26552655
return;
26562656

2657-
if (HaveLeadingSpace && !HaveDot)
2658-
return;
2659-
26602657
if (auto *VD = dyn_cast<VarDecl>(D)) {
26612658
addVarDeclRef(VD, Reason);
26622659
return;

test/IDE/complete_value_expr.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@
170170
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_TYPEALIAS_1 | FileCheck %s -check-prefix=GENERIC_TYPEALIAS_1
171171
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_TYPEALIAS_2 | FileCheck %s -check-prefix=GENERIC_TYPEALIAS_2
172172

173-
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AFTER_SPACE_1 | FileCheck %s -check-prefix=AFTER_SPACE_1
174-
175173
// Test code completion of expressions that produce a value.
176174

177175
struct FooStruct {
@@ -1884,8 +1882,3 @@ func testGenericTypealias2() {
18841882
Enclose.#^GENERIC_TYPEALIAS_2^#
18851883
}
18861884
// GENERIC_TYPEALIAS_2: Decl[TypeAlias]/CurrNominal: MyPair[#(T, T)#];
1887-
1888-
func testAfterSpace(x: Int?) {
1889-
x #^AFTER_SPACE_1^#
1890-
// AFTER_SPACE_1-NOT: CurrNominal
1891-
}

test/SourceKit/CodeComplete/complete_operators.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// RUN: %complete-test -tok=OPT_OPERATORS %s | FileCheck %s -check-prefix=OPT
66
// RUN: %complete-test -tok=KNOWN_OPERATORS_1 %s | FileCheck %s -check-prefix=KNOWN
77
// RUN: %complete-test -tok=KNOWN_OPERATORS_2 %s | FileCheck %s -check-prefix=KNOWN
8-
// RUN: %complete-test -tok=NO_DOT %s | FileCheck %s -check-prefix=NO_DOT
98

109
struct MyInt {
1110
var bigPowers: Int { return 1 }
@@ -168,11 +167,3 @@ func test6(x: DoesEverything) {
168167
// KNOWN: ===
169168
// KNOWN: !==
170169
// KNOWN: ~=
171-
172-
func test7() {
173-
var x: DoesEverything
174-
x #^NO_DOT^#
175-
}
176-
// NO_DOT-NOT: .
177-
// NO_DOT: =
178-
// NO_DOT: ==

0 commit comments

Comments
 (0)