File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2654,6 +2654,9 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
2654
2654
if (HaveLParen)
2655
2655
return ;
2656
2656
2657
+ if (HaveLeadingSpace && !HaveDot)
2658
+ return ;
2659
+
2657
2660
if (auto *VD = dyn_cast<VarDecl>(D)) {
2658
2661
addVarDeclRef (VD, Reason);
2659
2662
return ;
Original file line number Diff line number Diff line change 170
170
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_TYPEALIAS_1 | FileCheck %s -check-prefix=GENERIC_TYPEALIAS_1
171
171
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_TYPEALIAS_2 | FileCheck %s -check-prefix=GENERIC_TYPEALIAS_2
172
172
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
+
173
175
// Test code completion of expressions that produce a value.
174
176
175
177
struct FooStruct {
@@ -1882,3 +1884,8 @@ func testGenericTypealias2() {
1882
1884
Enclose. #^GENERIC_TYPEALIAS_2^#
1883
1885
}
1884
1886
// 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
+ }
Original file line number Diff line number Diff line change 5
5
// RUN: %complete-test -tok=OPT_OPERATORS %s | FileCheck %s -check-prefix=OPT
6
6
// RUN: %complete-test -tok=KNOWN_OPERATORS_1 %s | FileCheck %s -check-prefix=KNOWN
7
7
// 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
8
9
9
10
struct MyInt {
10
11
var bigPowers : Int { return 1 }
@@ -167,3 +168,11 @@ func test6(x: DoesEverything) {
167
168
// KNOWN: ===
168
169
// KNOWN: !==
169
170
// KNOWN: ~=
171
+
172
+ func test7( ) {
173
+ var x : DoesEverything
174
+ x #^NO_DOT^#
175
+ }
176
+ // NO_DOT-NOT: .
177
+ // NO_DOT: =
178
+ // NO_DOT: ==
You can’t perform that action at this time.
0 commit comments