File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -3591,6 +3591,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
3591
3591
bool IncludeTopLevel = false ,
3592
3592
bool RequestCache = true ,
3593
3593
bool LiteralCompletions = true ) {
3594
+ ExprType = Type ();
3594
3595
Kind = LookupKind::ValueInDeclContext;
3595
3596
NeedLeadingDot = false ;
3596
3597
FilteredDeclConsumer Consumer (*this , Filter);
Original file line number Diff line number Diff line change
1
+ // RUN: %swift-ide-test -code-completion -code-completion-token=A -source-filename %s
2
+ // RUN: %swift-ide-test -code-completion -code-completion-token=B -source-filename %s
3
+ // RUN: %swift-ide-test -code-completion -code-completion-token=C -source-filename %s
4
+ // RUN: %swift-ide-test -code-completion -code-completion-token=D -source-filename %s
5
+ // RUN: %swift-ide-test -code-completion -code-completion-token=E -source-filename %s
6
+ // RUN: %swift-ide-test -code-completion -code-completion-token=F -source-filename %s
7
+
8
+ // Make sure that visible members don't mess up code completion,
9
+ // having seen a constructor for an incompatible declaration.
10
+
11
+ class CompeteInMethod {
12
+ // Here, the method foo is actually visible at the
13
+ // point of code-completion.
14
+ func foo( ) {
15
+ String( #^A^#
16
+ }
17
+ }
18
+
19
+ class CompleteInVar {
20
+ // Same here - var decls are added to code completion results
21
+ // in a different but similarly shaped code path. So here,
22
+ // the var x is actually visible at the point of code-completion.
23
+ var x : Int {
24
+ String( #^B^#
25
+ }
26
+ }
27
+
28
+ class CompleteOutsideMethod {
29
+ func foo( ) { }
30
+ init ( ) {
31
+ String( #^C^#
32
+ }
33
+ }
34
+
35
+ class CompleteOutsideVar {
36
+ var x : Int { return 1 }
37
+ init ( ) {
38
+ String( #^D^#
39
+ }
40
+ }
41
+
42
+ class CompleteInsideGenericFunc {
43
+ func foo< S: Sequence > ( x: S ) {
44
+ String( #^E^#
45
+ }
46
+ }
47
+
48
+ class CompleteInsideGenericClass < S: Sequence > {
49
+ func foo( x: S ) {
50
+ String( #^F^#
51
+ }
52
+ }
You can’t perform that action at this time.
0 commit comments