Skip to content

Commit 93632f0

Browse files
authored
Merge pull request swiftlang#23716 from rintaro/ide-completion-calleedecl-rdar49158044
[CodeCompletion] Associate callee declaration with call patterns
2 parents cf5d81c + 0c38f2d commit 93632f0

13 files changed

+138
-80
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
16411641

16421642
void setExpectedTypes(ArrayRef<Type> Types, bool isSingleExpressionBody) {
16431643
expectedTypeContext.isSingleExpressionBody = isSingleExpressionBody;
1644+
expectedTypeContext.possibleTypes.clear();
16441645
expectedTypeContext.possibleTypes.reserve(Types.size());
16451646
for (auto T : Types)
16461647
if (T)
@@ -2242,22 +2243,56 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
22422243
Builder.addRightParen();
22432244
}
22442245

2246+
SemanticContextKind getSemanticContextKind(const AbstractFunctionDecl *AFD) {
2247+
// FIXME: to get the corect semantic context we need to know how lookup
2248+
// would have found the declaration AFD. For now, just infer a reasonable
2249+
// semantics.
2250+
2251+
if (!AFD)
2252+
return SemanticContextKind::CurrentModule;
2253+
2254+
DeclContext *calleeDC = AFD->getDeclContext();
2255+
2256+
if (calleeDC->isTypeContext())
2257+
// FIXME: We should distinguish CurrentNominal and Super. We need to
2258+
// propagate the base type to do that.
2259+
return SemanticContextKind::CurrentNominal;
2260+
2261+
if (calleeDC->isLocalContext())
2262+
return SemanticContextKind::Local;
2263+
if (calleeDC->getParentModule() == CurrDeclContext->getParentModule())
2264+
return SemanticContextKind::CurrentModule;
2265+
2266+
return SemanticContextKind::OtherModule;
2267+
}
2268+
22452269
void addFunctionCallPattern(const AnyFunctionType *AFT,
22462270
const AbstractFunctionDecl *AFD = nullptr) {
2271+
if (AFD) {
2272+
auto genericSig =
2273+
AFD->getInnermostDeclContext()->getGenericSignatureOfContext();
2274+
AFT = eraseArchetypes(CurrDeclContext->getParentModule(),
2275+
const_cast<AnyFunctionType *>(AFT), genericSig)
2276+
->castTo<AnyFunctionType>();
2277+
}
22472278

22482279
// Add the pattern, possibly including any default arguments.
22492280
auto addPattern = [&](ArrayRef<const ParamDecl *> declParams = {},
22502281
bool includeDefaultArgs = true) {
2251-
// FIXME: to get the corect semantic context we need to know how lookup
2252-
// would have found the declaration AFD. For now, just choose a reasonable
2253-
// default, it's most likely to be CurrentModule or CurrentNominal.
2282+
CommandWordsPairs Pairs;
22542283
CodeCompletionResultBuilder Builder(
2255-
Sink, CodeCompletionResult::ResultKind::Pattern,
2256-
SemanticContextKind::CurrentModule, expectedTypeContext);
2284+
Sink,
2285+
AFD ? CodeCompletionResult::ResultKind::Declaration
2286+
: CodeCompletionResult::ResultKind::Pattern,
2287+
getSemanticContextKind(AFD), expectedTypeContext);
22572288
if (!HaveLParen)
22582289
Builder.addLeftParen();
22592290
else
22602291
Builder.addAnnotatedLeftParen();
2292+
if (AFD) {
2293+
Builder.setAssociatedDecl(AFD);
2294+
setClangDeclKeywords(AFD, Pairs, Builder);
2295+
}
22612296

22622297
addCallArgumentPatterns(Builder, AFT->getParams(), declParams,
22632298
includeDefaultArgs);
@@ -5066,14 +5101,17 @@ void CodeCompletionCallbacksImpl::doneParsing() {
50665101
Lookup.setHaveLParen(true);
50675102

50685103
ExprContextInfo ContextInfo(CurDeclContext, CodeCompleteTokenExpr);
5069-
Lookup.setExpectedTypes(ContextInfo.getPossibleTypes(),
5070-
ContextInfo.isSingleExpressionBody());
5104+
50715105
if (ShouldCompleteCallPatternAfterParen) {
5072-
if (ExprType) {
5106+
ExprContextInfo ParentContextInfo(CurDeclContext, ParsedExpr);
5107+
Lookup.setExpectedTypes(ParentContextInfo.getPossibleTypes(),
5108+
ParentContextInfo.isSingleExpressionBody());
5109+
if (ExprType && ((*ExprType)->is<AnyFunctionType>() ||
5110+
(*ExprType)->is<AnyMetatypeType>())) {
50735111
Lookup.getValueExprCompletions(*ExprType, ReferencedDecl.getDecl());
50745112
} else {
50755113
for (auto &typeAndDecl : ContextInfo.getPossibleCallees())
5076-
Lookup.getValueExprCompletions(typeAndDecl.first, typeAndDecl.second);
5114+
Lookup.tryFunctionCallCompletions(typeAndDecl.first, typeAndDecl.second);
50775115
}
50785116
} else {
50795117
// Add argument labels, then fallthrough to get values.
@@ -5083,6 +5121,8 @@ void CodeCompletionCallbacksImpl::doneParsing() {
50835121
if (!Lookup.FoundFunctionCalls ||
50845122
(Lookup.FoundFunctionCalls &&
50855123
Lookup.FoundFunctionsWithoutFirstKeyword)) {
5124+
Lookup.setExpectedTypes(ContextInfo.getPossibleTypes(),
5125+
ContextInfo.isSingleExpressionBody());
50865126
Lookup.setHaveLParen(false);
50875127
DoPostfixExprBeginning();
50885128
}

lib/IDE/ExprContextAnalysis.cpp

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "swift/AST/Decl.h"
1717
#include "swift/AST/DeclContext.h"
1818
#include "swift/AST/Expr.h"
19+
#include "swift/AST/GenericSignature.h"
1920
#include "swift/AST/Initializer.h"
2021
#include "swift/AST/LazyResolver.h"
2122
#include "swift/AST/Module.h"
@@ -194,7 +195,7 @@ namespace {
194195
class ExprParentFinder : public ASTWalker {
195196
friend class ExprContextAnalyzer;
196197
Expr *ChildExpr;
197-
llvm::function_ref<bool(ParentTy, ParentTy)> Predicate;
198+
std::function<bool(ParentTy, ParentTy)> Predicate;
198199

199200
bool arePositionsSame(Expr *E1, Expr *E2) {
200201
return E1->getSourceRange().Start == E2->getSourceRange().Start &&
@@ -204,7 +205,7 @@ class ExprParentFinder : public ASTWalker {
204205
public:
205206
llvm::SmallVector<ParentTy, 5> Ancestors;
206207
ExprParentFinder(Expr *ChildExpr,
207-
llvm::function_ref<bool(ParentTy, ParentTy)> Predicate)
208+
std::function<bool(ParentTy, ParentTy)> Predicate)
208209
: ChildExpr(ChildExpr), Predicate(Predicate) {}
209210

210211
std::pair<bool, Expr *> walkToExprPre(Expr *E) override {
@@ -271,7 +272,8 @@ static void collectPossibleCalleesByQualifiedLookup(
271272
SmallVector<ValueDecl *, 2> decls;
272273
auto resolver = DC.getASTContext().getLazyResolver();
273274
if (!DC.lookupQualified(baseTy->getMetatypeInstanceType(), name,
274-
NL_QualifiedDefault, resolver, decls))
275+
NL_QualifiedDefault | NL_ProtocolMembers, resolver,
276+
decls))
275277
return;
276278

277279
for (auto *VD : decls) {
@@ -303,8 +305,19 @@ static void collectPossibleCalleesByQualifiedLookup(
303305

304306
if (!fnType)
305307
continue;
306-
if (auto *AFT = fnType->getAs<AnyFunctionType>()) {
307-
candidates.emplace_back(AFT, VD);
308+
309+
if (fnType->is<AnyFunctionType>()) {
310+
auto baseInstanceTy = baseTy->getMetatypeInstanceType();
311+
// If we are calling to typealias type,
312+
if (isa<SugarType>(baseInstanceTy.getPointer())) {
313+
auto canBaseTy = baseInstanceTy->getCanonicalType();
314+
fnType = fnType.transform([&](Type t) -> Type {
315+
if (t->getCanonicalType()->isEqual(canBaseTy))
316+
return baseInstanceTy;
317+
return t;
318+
});
319+
}
320+
candidates.emplace_back(fnType->castTo<AnyFunctionType>(), VD);
308321
}
309322
}
310323
}
@@ -657,15 +670,23 @@ class ExprContextAnalyzer {
657670
if (!ParsedExpr)
658671
return;
659672

660-
ExprParentFinder Finder(ParsedExpr, [](ASTWalker::ParentTy Node,
661-
ASTWalker::ParentTy Parent) {
673+
ExprParentFinder Finder(ParsedExpr, [&](ASTWalker::ParentTy Node,
674+
ASTWalker::ParentTy Parent) {
662675
if (auto E = Node.getAsExpr()) {
663676
switch (E->getKind()) {
664-
case ExprKind::Call:
677+
case ExprKind::Call: {
678+
// Iff the cursor is in argument position.
679+
auto argsRange = cast<CallExpr>(E)->getArg()->getSourceRange();
680+
return SM.rangeContains(argsRange, ParsedExpr->getSourceRange());
681+
}
682+
case ExprKind::Subscript: {
683+
// Iff the cursor is in index position.
684+
auto argsRange = cast<SubscriptExpr>(E)->getIndex()->getSourceRange();
685+
return SM.rangeContains(argsRange, ParsedExpr->getSourceRange());
686+
}
665687
case ExprKind::Binary:
666688
case ExprKind::PrefixUnary:
667689
case ExprKind::Assign:
668-
case ExprKind::Subscript:
669690
case ExprKind::Array:
670691
return true;
671692
case ExprKind::Tuple: {

test/IDE/complete_at_eof_in_call_1.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Don't add any tests at the end of the file!
55
//
66
// A: Begin completions
7-
// A-DAG: Pattern/CurrModule: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
7+
// A-DAG: Decl[FreeFunction]/CurrModule: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
88
// A: End completions
99
func f(_ x: Int) {}
1010
f(#^A^#

test/IDE/complete_at_eof_in_call_no_newline_1.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Don't add any tests at the end of the file!
55
//
66
// A: Begin completions
7-
// A-DAG: Pattern/CurrModule: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
7+
// A-DAG: Decl[FreeFunction]/CurrModule: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
88
// A: End completions
99
func f(_ x: Int) {}
1010
f(#^A^#

test/IDE/complete_call_arg.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ class C3 {
246246

247247
func f6(obj: C3) {
248248
overloaded(#^OVERLOAD6^#
249+
func sync() {}
249250
obj.overloaded(#^OVERLOAD7^#
250251
}
251252
}
@@ -279,15 +280,15 @@ class C3 {
279280
// NEGATIVE_OVERLOAD4-NOT: Decl[Class]{{.*}} C2
280281

281282
// OVERLOAD5: Begin completions
282-
// OVERLOAD5-DAG: Pattern/CurrModule: ['(']{#(a): C1#}, {#b1: C2#}[')'][#Void#]; name=a: C1, b1: C2
283-
// OVERLOAD5-DAG: Pattern/CurrModule: ['(']{#(a): C2#}, {#b2: C1#}[')'][#Void#]; name=a: C2, b2: C1
283+
// OVERLOAD5-DAG: Decl[FreeFunction]/CurrModule: ['(']{#(a): C1#}, {#b1: C2#}[')'][#Void#]; name=a: C1, b1: C2
284+
// OVERLOAD5-DAG: Decl[FreeFunction]/CurrModule: ['(']{#(a): C2#}, {#b2: C1#}[')'][#Void#]; name=a: C2, b2: C1
284285
// OVERLOAD5-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C1I[#C1#]; name=C1I
285286
// OVERLOAD5-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C2I[#C2#]; name=C2I
286287
// OVERLOAD5: End completions
287288

288289
// OVERLOAD6: Begin completions
289-
// OVERLOAD6-DAG: Pattern/CurrModule: ['(']{#(a1): C1#}, {#b1: C2#}[')'][#Void#]; name=a1: C1, b1: C2
290-
// OVERLOAD6-DAG: Pattern/CurrModule: ['(']{#a2: C2#}, {#b2: C1#}[')'][#Void#]; name=a2: C2, b2: C1
290+
// OVERLOAD6-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(a1): C1#}, {#b1: C2#}[')'][#Void#]; name=a1: C1, b1: C2
291+
// OVERLOAD6-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#a2: C2#}, {#b2: C1#}[')'][#Void#]; name=a2: C2, b2: C1
291292
// OVERLOAD6-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C1I[#C1#]; name=C1I
292293
// OVERLOAD6-DAG: Decl[InstanceVar]/CurrNominal: C2I[#C2#]; name=C2I
293294
// OVERLOAD6: End completions
@@ -304,7 +305,7 @@ extension C3 {
304305
}
305306

306307
// HASERROR1: Begin completions
307-
// HASERROR1-DAG: Pattern/CurrModule: ['(']{#a1: C1#}, {#b1: <<error type>>#}[')'][#Int#];
308+
// HASERROR1-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#a1: C1#}, {#b1: <<error type>>#}[')'][#Int#];
308309
// HASERROR1: End completions
309310

310311
// HASERROR2: Begin completions
@@ -442,7 +443,7 @@ func testArg2Name3() {
442443
firstArg(#^FIRST_ARG_NAME_3^#,
443444
}
444445
// FIRST_ARG_NAME_3: Keyword/ExprSpecific: arg1: [#Argument name#]
445-
// FIRST_ARG_NAME_4: Pattern/CurrModule: ['(']{#arg1: Int#}, {#arg2: Int#}[')'][#Void#];
446+
// FIRST_ARG_NAME_4: Decl[FreeFunction]/CurrModule: ['(']{#arg1: Int#}, {#arg2: Int#}[')'][#Void#];
446447

447448
func takeArray<T>(_ x: [T]) {}
448449
struct TestBoundGeneric1 {
@@ -484,7 +485,7 @@ public func fopen() -> TestBoundGeneric1! { fatalError() }
484485
func other() {
485486
_ = fopen(#^CALLARG_IUO^#)
486487
// CALLARG_IUO: Begin completions, 1 items
487-
// CALLARG_IUO: Pattern/CurrModule: ['('][')'][#TestBoundGeneric1!#]; name=
488+
// CALLARG_IUO: Decl[FreeFunction]/CurrModule: ['('][')'][#TestBoundGeneric1!#]; name=
488489
// CALLARG_IUO: End completions
489490
}
490491

@@ -601,12 +602,14 @@ class TestImplicitlyCurriedSelf {
601602

602603
static func test() {
603604
foo(#^CURRIED_SELF_1^#
605+
func sync();
604606
self.foo(#^CURRIED_SELF_2^#
607+
func sync();
605608
TestImplicitlyCurriedSelf.foo(#^CURRIED_SELF_3^#
606609

607610
// CURRIED_SELF_1: Begin completions, 2 items
608-
// CURRIED_SELF_1-DAG: Pattern/CurrModule: ['(']{#(self): TestImplicitlyCurriedSelf#}[')'][#(Int) -> ()#]{{; name=.+$}}
609-
// CURRIED_SELF_1-DAG: Pattern/CurrModule: ['(']{#(self): TestImplicitlyCurriedSelf#}[')'][#(Int, Int) -> ()#]{{; name=.+$}}
611+
// CURRIED_SELF_1-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(self): TestImplicitlyCurriedSelf#}[')'][#(Int) -> ()#]{{; name=.+$}}
612+
// CURRIED_SELF_1-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(self): TestImplicitlyCurriedSelf#}[')'][#(Int, Int) -> ()#]{{; name=.+$}}
610613
// CURRIED_SELF_1: End completions
611614
}
612615
}

test/IDE/complete_constructor.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_4 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
4949

5050
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_1 | %FileCheck %s -check-prefix=AVAILABLE_1
51-
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_2 | %FileCheck %s -check-prefix=AVAILABLE_2
51+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_2 | %FileCheck %s -check-prefix=AVAILABLE_1
5252

5353
func freeFunc() {}
5454

@@ -334,7 +334,7 @@ struct ClosureInInit1 {
334334
var prop1: S = {
335335
return S(#^CLOSURE_IN_INIT_1^#
336336
}
337-
// CLOSURE_IN_INIT_1: Decl[Constructor]/CurrNominal: ['(']{#Int#}[')'][#ClosureInInit1.S#];
337+
// CLOSURE_IN_INIT_1: Decl[Constructor]/CurrNominal{{(/TypeRelation\[Identical\])?}}: ['(']{#Int#}[')'][#ClosureInInit1.S#];
338338
var prop2: S = {
339339
return S(#^CLOSURE_IN_INIT_2^#
340340
}()
@@ -368,10 +368,4 @@ func testAvailable() {
368368
// AVAILABLE_1: End completions
369369

370370
let _ = AvailableTest.init(#^AVAILABLE_2^#
371-
// AVAILABLE_2: Begin completions, 3 items
372-
// AVAILABLE_2-DAG: Pattern/CurrModule: ['(']{#opt: Int#}[')'][#AvailableTest?#]; name=opt: Int
373-
// AVAILABLE_2-DAG: Pattern/CurrModule: ['(']{#normal1: Int#}[')'][#AvailableTest#]; name=normal1: Int
374-
// AVAILABLE_2-DAG: Pattern/CurrModule: ['(']{#normal2: Int#}[')'][#AvailableTest#]; name=normal2: Int
375-
// AVAILABLE_2: End completions
376-
377371
}

test/IDE/complete_default_arguments.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ func testDefaultArgs2() {
6767
freeFuncWithDefaultArgs1#^DEFAULT_ARGS_2^#
6868
}
6969
// DEFAULT_ARGS_2: Begin completions
70-
// DEFAULT_ARGS_2-DAG: Pattern/CurrModule: ({#(a): Int#})[#Void#]{{; name=.+$}}
71-
// DEFAULT_ARGS_2-DAG: Pattern/CurrModule: ({#(a): Int#}, {#b: Int#})[#Void#]{{; name=.+$}}
70+
// DEFAULT_ARGS_2-DAG: Decl[FreeFunction]/CurrModule: ({#(a): Int#})[#Void#]{{; name=.+$}}
71+
// DEFAULT_ARGS_2-DAG: Decl[FreeFunction]/CurrModule: ({#(a): Int#}, {#b: Int#})[#Void#]{{; name=.+$}}
7272
// DEFAULT_ARGS_2: End completions
7373

7474
func testDefaultArgs3() {
7575
freeFuncWithDefaultArgs3#^DEFAULT_ARGS_3^#
7676
}
7777
// DEFAULT_ARGS_3: Begin completions
78-
// DEFAULT_ARGS_3-DAG: Pattern/CurrModule: ()[#Void#]{{; name=.+$}}
79-
// DEFAULT_ARGS_3-DAG: Pattern/CurrModule: ({#a: Int#})[#Void#]{{; name=.+$}}
78+
// DEFAULT_ARGS_3-DAG: Decl[FreeFunction]/CurrModule: ()[#Void#]{{; name=.+$}}
79+
// DEFAULT_ARGS_3-DAG: Decl[FreeFunction]/CurrModule: ({#a: Int#})[#Void#]{{; name=.+$}}
8080
// DEFAULT_ARGS_3: End completions
8181

8282
func testDefaultArgs4(_ x: A) {
@@ -91,8 +91,8 @@ func testDefaultArgs5(_ x: A) {
9191
x.methodWithDefaultArgs1#^DEFAULT_ARGS_5^#
9292
}
9393
// DEFAULT_ARGS_5: Begin completions
94-
// DEFAULT_ARGS_5-DAG: Pattern/CurrModule: ()[#Void#]{{; name=.+$}}
95-
// DEFAULT_ARGS_5-DAG: Pattern/CurrModule: ({#a: Int#})[#Void#]{{; name=.+$}}
94+
// DEFAULT_ARGS_5-DAG: Decl[InstanceMethod]/CurrNominal: ()[#Void#]{{; name=.+$}}
95+
// DEFAULT_ARGS_5-DAG: Decl[InstanceMethod]/CurrNominal: ({#a: Int#})[#Void#]{{; name=.+$}}
9696
// DEFAULT_ARGS_5: End completions
9797

9898
func testDefaultArgs6() {

test/IDE/complete_dynamic_lookup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ func testAnyObject11_(_ dl: AnyObject) {
463463
dl.returnsObjcClass!(#^DL_FUNC_NAME_PAREN_1^#
464464
}
465465
// DL_FUNC_NAME_PAREN_1: Begin completions
466-
// DL_FUNC_NAME_PAREN_1-DAG: Pattern/CurrModule: ['(']{#(i): Int#}[')'][#TopLevelObjcClass#]{{; name=.+$}}
466+
// DL_FUNC_NAME_PAREN_1-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(i): Int#}[')'][#TopLevelObjcClass#]{{; name=.+$}}
467467
// DL_FUNC_NAME_PAREN_1: End completions
468468

469469
func testAnyObject12(_ dl: AnyObject) {
@@ -475,7 +475,7 @@ func testAnyObject13(_ dl: AnyObject) {
475475
dl.returnsObjcClass!#^DL_FUNC_NAME_BANG_1^#
476476
}
477477
// DL_FUNC_NAME_BANG_1: Begin completions
478-
// DL_FUNC_NAME_BANG_1-NEXT: Pattern/CurrModule: ({#(i): Int#})[#TopLevelObjcClass#]
478+
// DL_FUNC_NAME_BANG_1-NEXT: Decl[InstanceMethod]/CurrNominal: ({#(i): Int#})[#TopLevelObjcClass#]
479479
// DL_FUNC_NAME_BANG_1-NEXT: Keyword[self]/CurrNominal: .self[#(Int) -> TopLevelObjcClass#]; name=self
480480
// DL_FUNC_NAME_BANG_1-NEXT: End completions
481481

test/IDE/complete_from_clang_framework.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ func testCompleteModuleQualifiedBar1() {
227227
func testCompleteFunctionCall1() {
228228
fooFunc1#^FUNCTION_CALL_1^#
229229
// FUNCTION_CALL_1: Begin completions
230-
// FUNCTION_CALL_1-NEXT: Pattern/CurrModule: ({#(a): Int32#})[#Int32#]{{; name=.+$}}
230+
// FUNCTION_CALL_1-NEXT: Decl[FreeFunction]/OtherModule[Foo]: ({#(a): Int32#})[#Int32#]{{; name=.+$}}
231231
// FUNCTION_CALL_1-NEXT: Keyword[self]/CurrNominal: .self[#(Int32) -> Int32#]; name=self
232232
// FUNCTION_CALL_1-NEXT: End completions
233233
}
234234

235235
func testCompleteFunctionCall2() {
236236
fooFunc1AnonymousParam#^FUNCTION_CALL_2^#
237237
// FUNCTION_CALL_2: Begin completions
238-
// FUNCTION_CALL_2-NEXT: Pattern/CurrModule: ({#Int32#})[#Int32#]{{; name=.+$}}
238+
// FUNCTION_CALL_2-NEXT: Decl[FreeFunction]/OtherModule[Foo]: ({#Int32#})[#Int32#]{{; name=.+$}}
239239
// FUNCTION_CALL_2-NEXT: Keyword[self]/CurrNominal: .self[#(Int32) -> Int32#]; name=self
240240
// FUNCTION_CALL_2-NEXT: End completions
241241
}

test/IDE/complete_init_inherited.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class D : C {
7777

7878
// TEST_D_PAREN: Decl[Constructor]/CurrNominal: ['(']{#d: D#}[')'][#D#]; name=d: D
7979
// TEST_D_PAREN-NEXT: Decl[Constructor]/CurrNominal: ['(']{#int: Int#}[')'][#D#]; name=int: Int
80-
// TEST_D_PAREN-NEXT: Decl[Constructor]/Super: ['(']{#c: C#}[')'][#C#]; name=c: C
80+
// TEST_D_PAREN-NEXT: Decl[Constructor]/Super: ['(']{#c: C#}[')'][#C#]; name=c: C
8181

8282
func testA() {
8383
A#^TEST_A^#

0 commit comments

Comments
 (0)