Skip to content

Commit

Permalink
[IDE/CodeCompletion] Teach code completion to display the local param…
Browse files Browse the repository at this point in the history
…eter name

if there's no parameter API name. This is for display purposes only.
Update all relevant tests accordingly.
This addresses <rdar://problem/16768768>.

For example:
  class X {
    func f(a: Int, b: Int) { }
  }

Would previously display like this in code completion in Xcode:
  f(<#Int#>, b: <#Int#>)

The local parameter name, while not API, often still conveys meaning
to the user. So it's now included like this:
  f(<#a: Int#>, b: <#Int#>)

Swift SVN r18403
  • Loading branch information
sonnyfalk committed May 19, 2014
1 parent 5819454 commit a268024
Show file tree
Hide file tree
Showing 14 changed files with 274 additions and 185 deletions.
5 changes: 5 additions & 0 deletions include/swift/IDE/CodeCompletion.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ class CodeCompletionString {
CallParameterBegin,
/// Function call parameter name. Can be omitted in the editor buffer.
CallParameterName,
/// Function call parameter internal / local name. If the parameter has no
/// formal API name, it can still have a local name which can be useful
/// for display purposes. Can be ommitted in the editor buffer.
CallParameterInternalName,
/// A colon between parameter name and value. Should be inserted in the
/// editor buffer if the preceding CallParameterName was inserted.
CallParameterColon,
Expand Down Expand Up @@ -142,6 +146,7 @@ class CodeCompletionString {
Kind == ChunkKind::QuestionMark ||
Kind == ChunkKind::Ampersand ||
Kind == ChunkKind::CallParameterName ||
Kind == ChunkKind::CallParameterInternalName ||
Kind == ChunkKind::CallParameterColon ||
Kind == ChunkKind::CallParameterType ||
Kind == ChunkKind::GenericParameterName ||
Expand Down
84 changes: 77 additions & 7 deletions lib/IDE/CodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,14 @@ void CodeCompletionString::print(raw_ostream &OS) const {
AnnotatedTextChunk = C.isAnnotation();
SWIFT_FALLTHROUGH;
case Chunk::ChunkKind::CallParameterName:
case Chunk::ChunkKind::CallParameterInternalName:
case Chunk::ChunkKind::CallParameterColon:
case Chunk::ChunkKind::CallParameterType:
case CodeCompletionString::Chunk::ChunkKind::GenericParameterName:
if (AnnotatedTextChunk)
OS << "['";
else if (C.getKind() == Chunk::ChunkKind::CallParameterInternalName)
OS << "(";
for (char Ch : C.getText()) {
if (Ch == '\n')
OS << "\\n";
Expand All @@ -157,6 +160,8 @@ void CodeCompletionString::print(raw_ostream &OS) const {
}
if (AnnotatedTextChunk)
OS << "']";
else if (C.getKind() == Chunk::ChunkKind::CallParameterInternalName)
OS << ")";
break;
case Chunk::ChunkKind::OptionalBegin:
case Chunk::ChunkKind::CallParameterBegin:
Expand Down Expand Up @@ -638,6 +643,7 @@ Optional<unsigned> CodeCompletionString::getFirstTextChunkIndex() const {
case CodeCompletionString::Chunk::ChunkKind::OverrideKeyword:
case CodeCompletionString::Chunk::ChunkKind::DeclIntroducer:
case CodeCompletionString::Chunk::ChunkKind::CallParameterName:
case CodeCompletionString::Chunk::ChunkKind::CallParameterInternalName:
case CodeCompletionString::Chunk::ChunkKind::CallParameterColon:
case CodeCompletionString::Chunk::ChunkKind::CallParameterType:
case CodeCompletionString::Chunk::ChunkKind::OptionalBegin:
Expand Down Expand Up @@ -1243,7 +1249,42 @@ class CompletionLookup : public swift::VisibleDeclConsumer {
addPatternFromTypeImpl(Builder, T, Identifier(), true);
}

void addFunctionCall(const AnyFunctionType *AFT) {
void addParamPatternFromFunction(CodeCompletionResultBuilder &Builder,
const AbstractFunctionDecl *AFD,
const AnyFunctionType *AFT) {
auto BodyPatterns = AFD->getBodyParamPatterns();
// Skip over the implicit 'self'.
if (AFD->getImplicitSelfDecl()) {
BodyPatterns = BodyPatterns.slice(1);
}

ArrayRef<Identifier> ArgNames;
DeclName Name = AFD->getFullName();
if (Name) {
ArgNames = Name.getArgumentNames();
}

if (!BodyPatterns.empty()) {
if (auto *BodyTuple = dyn_cast<TuplePattern>(BodyPatterns.front())) {
for (unsigned i = 0, e = BodyTuple->getFields().size(); i != e; ++i) {
if (i > 0)
Builder.addComma();
auto ParamPattern = BodyTuple->getFields()[i].getPattern();
Builder.addCallParameter(ArgNames[i], ParamPattern->getBoundName(),
ParamPattern->getType());
}
} else {
Type T = AFT->getInput();
if (auto *PT = dyn_cast<ParenType>(T.getPointer())) {
// Only unwrap the paren sugar, if it exists.
T = PT->getUnderlyingType();
}
Builder.addCallParameter(Identifier(), T);
}
}
}

void addFunctionCallPattern(const AnyFunctionType *AFT) {
foundFunction(AFT);
CodeCompletionResultBuilder Builder(
Sink,
Expand Down Expand Up @@ -1273,6 +1314,23 @@ class CompletionLookup : public swift::VisibleDeclConsumer {
addTypeAnnotation(Builder, AFT->getResult());
}

void addFunctionCallPattern(const AbstractFunctionDecl *AFD, const AnyFunctionType *AFT) {
foundFunction(AFT);
CodeCompletionResultBuilder Builder(
Sink,
CodeCompletionResult::ResultKind::Pattern,
SemanticContextKind::ExpressionSpecific);
if (!HaveLParen)
Builder.addLeftParen();
else
Builder.addAnnotatedLeftParen();

addParamPatternFromFunction(Builder, AFD, AFT);

Builder.addRightParen();
addTypeAnnotation(Builder, AFT->getResult());
}

void addMethodCall(const FuncDecl *FD, DeclVisibilityKind Reason) {
foundFunction(FD);
bool IsImplicitlyCurriedInstanceMethod;
Expand Down Expand Up @@ -1344,7 +1402,10 @@ class CompletionLookup : public swift::VisibleDeclConsumer {
Builder.addCallParameter(Ctx.Id_self, FirstInputType);
Builder.addRightParen();
} else {
addPatternFromType(Builder, FirstInputType);
Builder.addLeftParen();
addParamPatternFromFunction(Builder, FD,
FunctionType->castTo<AnyFunctionType>());
Builder.addRightParen();
}

FunctionType = FunctionType->castTo<AnyFunctionType>()->getResult();
Expand Down Expand Up @@ -1698,10 +1759,14 @@ class CompletionLookup : public swift::VisibleDeclConsumer {
}
}

bool tryFunctionCallCompletions(Type ExprType) {
bool tryFunctionCallCompletions(Type ExprType, ValueDecl *VD) {
ExprType = ExprType->getRValueType();
if (auto AFT = ExprType->getAs<AnyFunctionType>()) {
addFunctionCall(AFT);
if (auto *AFD = dyn_cast_or_null<AbstractFunctionDecl>(VD)) {
addFunctionCallPattern(AFD, AFT);
} else {
addFunctionCallPattern(AFT);
}
return true;
}
return false;
Expand Down Expand Up @@ -1740,12 +1805,12 @@ class CompletionLookup : public swift::VisibleDeclConsumer {
return true;
}

void getValueExprCompletions(Type ExprType) {
void getValueExprCompletions(Type ExprType, ValueDecl *VD = nullptr) {
Kind = LookupKind::ValueExpr;
NeedLeadingDot = !HaveDot;
this->ExprType = ExprType;
bool Done = false;
if (tryFunctionCallCompletions(ExprType))
if (tryFunctionCallCompletions(ExprType, VD))
Done = true;
if (auto MT = ExprType->getAs<ModuleType>()) {
Module *M = MT->getModule();
Expand Down Expand Up @@ -2223,8 +2288,13 @@ void CodeCompletionCallbacksImpl::doneParsing() {

case CompletionKind::PostfixExprParen: {
Lookup.setHaveLParen(true);
ValueDecl *VD = nullptr;
if (auto *AE = dyn_cast<ApplyExpr>(ParsedExpr)) {
if (auto *DRE = dyn_cast<DeclRefExpr>(AE->getFn()))
VD = DRE->getDecl();
}
if (ParsedExpr->getType())
Lookup.getValueExprCompletions(ParsedExpr->getType());
Lookup.getValueExprCompletions(ParsedExpr->getType(), VD);

if (!Lookup.FoundFunctionCalls ||
(Lookup.FoundFunctionCalls &&
Expand Down
15 changes: 14 additions & 1 deletion lib/IDE/CodeCompletionResultBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class CodeCompletionResultBuilder {
CodeCompletionString::Chunk::ChunkKind::QuestionMark, "?");
}

void addCallParameter(Identifier Name, Type Ty) {
void addCallParameter(Identifier Name, Identifier LocalName, Type Ty) {
CurrentNestingLevel++;

addSimpleChunk(CodeCompletionString::Chunk::ChunkKind::CallParameterBegin);
Expand Down Expand Up @@ -182,11 +182,24 @@ class CodeCompletionResultBuilder {
Ty = IOT->getObjectType();
}

if (Name.empty() && !LocalName.empty()) {
// Use local (non-API) parameter name if we have nothing else.
addChunkWithText(
CodeCompletionString::Chunk::ChunkKind::CallParameterInternalName,
LocalName.str());
addChunkWithTextNoCopy(
CodeCompletionString::Chunk::ChunkKind::CallParameterColon, ": ");
}

addChunkWithText(CodeCompletionString::Chunk::ChunkKind::CallParameterType,
Ty->getString());
CurrentNestingLevel--;
}

void addCallParameter(Identifier Name, Type Ty) {
addCallParameter(Name, Identifier(), Ty);
}

void addGenericParameter(StringRef Name) {
CurrentNestingLevel++;
addSimpleChunk(
Expand Down
1 change: 1 addition & 0 deletions lib/IDE/REPLCodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ std::string toInsertableString(CodeCompletionResult *Result) {
break;

case CodeCompletionString::Chunk::ChunkKind::CallParameterName:
case CodeCompletionString::Chunk::ChunkKind::CallParameterInternalName:
case CodeCompletionString::Chunk::ChunkKind::CallParameterColon:
case CodeCompletionString::Chunk::ChunkKind::CallParameterType:
case CodeCompletionString::Chunk::ChunkKind::OptionalBegin:
Expand Down
4 changes: 2 additions & 2 deletions test/IDE/complete_after_self.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ThisDerived1 : ThisBase1 {
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceVar]/CurrNominal: .derivedExtStaticProp[#Int#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceVar]/Super: .baseInstanceVar[#Int#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceMethod]/Super: .baseFunc0()[#Void#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceMethod]/Super: .baseFunc1({#Int#})[#Void#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceMethod]/Super: .baseFunc1({#(a): Int#})[#Void#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[Subscript]/Super: [{#i: Int#}][#Double#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceVar]/Super: .baseExtProp[#Int#]{{$}}
// COMMON_SELF_NO_DOT_1-DAG: Decl[InstanceMethod]/Super: .baseExtInstanceFunc0()[#Void#]{{$}}
Expand All @@ -131,7 +131,7 @@ class ThisDerived1 : ThisBase1 {
// COMMON_SELF_DOT_1-DAG: Decl[InstanceVar]/CurrNominal: derivedExtStaticProp[#Int#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceVar]/Super: baseInstanceVar[#Int#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceMethod]/Super: baseFunc0()[#Void#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceMethod]/Super: baseFunc1({#Int#})[#Void#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceMethod]/Super: baseFunc1({#(a): Int#})[#Void#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceVar]/Super: baseExtProp[#Int#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceMethod]/Super: baseExtInstanceFunc0()[#Void#]{{$}}
// COMMON_SELF_DOT_1-DAG: Decl[InstanceVar]/Super: baseExtStaticVar[#Int#]{{$}}
Expand Down
18 changes: 9 additions & 9 deletions test/IDE/complete_after_super.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ extension SuperBaseA {
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceVar]/CurrNominal: .baseInstanceVar[#Int#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceVar]/CurrNominal: .baseProp[#Int#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseFunc0()[#Void#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseFunc1({#Int#})[#Void#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseFunc1({#(a): Int#})[#Void#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[Subscript]/CurrNominal: [{#i: Int#}][#Double#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceVar]/CurrNominal: .baseExtProp[#Int#]{{$}}
// COMMON_BASE_A_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseExtFunc0()[#Void#]{{$}}
Expand All @@ -186,7 +186,7 @@ extension SuperBaseA {
// COMMON_BASE_A_DOT-DAG: Decl[InstanceVar]/CurrNominal: baseInstanceVar[#Int#]{{$}}
// COMMON_BASE_A_DOT-DAG: Decl[InstanceVar]/CurrNominal: baseProp[#Int#]{{$}}
// COMMON_BASE_A_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseFunc0()[#Void#]{{$}}
// COMMON_BASE_A_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseFunc1({#Int#})[#Void#]{{$}}
// COMMON_BASE_A_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseFunc1({#(a): Int#})[#Void#]{{$}}
// COMMON_BASE_A_DOT-DAG: Decl[InstanceVar]/CurrNominal: baseExtProp[#Int#]{{$}}
// COMMON_BASE_A_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseExtFunc0()[#Void#]{{$}}
// COMMON_BASE_A_DOT: End completions
Expand Down Expand Up @@ -248,7 +248,7 @@ class SuperDerivedA : SuperBaseA {
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceVar]/CurrNominal: .baseInstanceVar[#Int#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceVar]/CurrNominal: .baseProp[#Int#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseFunc0()[#Void#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseFunc1({#Int#})[#Void#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseFunc1({#(a): Int#})[#Void#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[Subscript]/CurrNominal: [{#i: Int#}][#Double#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceVar]/CurrNominal: .baseExtProp[#Int#]{{$}}
// COMMON_BASE_B_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .baseExtFunc0()[#Void#]{{$}}
Expand All @@ -258,7 +258,7 @@ class SuperDerivedA : SuperBaseA {
// COMMON_BASE_B_DOT-DAG: Decl[InstanceVar]/CurrNominal: baseInstanceVar[#Int#]{{$}}
// COMMON_BASE_B_DOT-DAG: Decl[InstanceVar]/CurrNominal: baseProp[#Int#]{{$}}
// COMMON_BASE_B_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseFunc0()[#Void#]{{$}}
// COMMON_BASE_B_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseFunc1({#Int#})[#Void#]{{$}}
// COMMON_BASE_B_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseFunc1({#(a): Int#})[#Void#]{{$}}
// COMMON_BASE_B_DOT-DAG: Decl[InstanceVar]/CurrNominal: baseExtProp[#Int#]{{$}}
// COMMON_BASE_B_DOT-DAG: Decl[InstanceMethod]/CurrNominal: baseExtFunc0()[#Void#]{{$}}
// COMMON_BASE_B_DOT: End completions
Expand Down Expand Up @@ -408,35 +408,35 @@ class SemanticContextDerived1 : SemanticContextBase1 {
#^SEMANTIC_CONTEXT_OVERRIDDEN_DECL_1^#
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_1: Begin completions
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_1-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc1()[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_1-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_1-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#(a): Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_1: End completions

super.#^SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2^#
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2: Begin completions
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2-NEXT: Decl[Constructor]/CurrNominal: init()[#SemanticContextBase1#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2-NEXT: Decl[Constructor]/ExprSpecific: init({#a: Int#})[#SemanticContextBase1#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1()[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#(a): Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_2-NEXT: End completions
}
func instanceFunc1() {
#^SEMANTIC_CONTEXT_OVERRIDDEN_DECL_3^#
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_3: Begin completions
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_3-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc1()[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_3-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_3-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#(a): Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_3: End completions

super.#^SEMANTIC_CONTEXT_OVERRIDDEN_DECL_4^#
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_4: Begin completions
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_4-NEXT: Decl[InstanceMethod]/ExprSpecific: instanceFunc1()[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_4-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_4-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#(a): Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_4-NEXT: End completions
}
func instanceFunc1(a: Int) {
super.#^SEMANTIC_CONTEXT_OVERRIDDEN_DECL_5^#
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_5: Begin completions
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_5-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1()[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_5-NEXT: Decl[InstanceMethod]/ExprSpecific: instanceFunc1({#Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_5-NEXT: Decl[InstanceMethod]/ExprSpecific: instanceFunc1({#(a): Int#})[#Void#]{{$}}
// SEMANTIC_CONTEXT_OVERRIDDEN_DECL_5-NEXT: End completions
}
}
Expand Down
14 changes: 7 additions & 7 deletions test/IDE/complete_at_top_level.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func resyncParser1() {}
fooObject#^TYPE_CHECKED_EXPR_1^#
// TYPE_CHECKED_EXPR_1: Begin completions
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{$}}
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_1-NEXT: End completions

func resyncParser2() {}
Expand All @@ -89,31 +89,31 @@ var _tmpVar1 : FooStruct
fooObject#^TYPE_CHECKED_EXPR_2^#
// TYPE_CHECKED_EXPR_2: Begin completions
// TYPE_CHECKED_EXPR_2-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{$}}
// TYPE_CHECKED_EXPR_2-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_2-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_2-NEXT: End completions

func resyncParser3() {}

fooObject#^TYPE_CHECKED_EXPR_3^#.bar
// TYPE_CHECKED_EXPR_3: Begin completions
// TYPE_CHECKED_EXPR_3-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{$}}
// TYPE_CHECKED_EXPR_3-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_3-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_3-NEXT: End completions

func resyncParser4() {}

fooObject.#^TYPE_CHECKED_EXPR_4^#
// TYPE_CHECKED_EXPR_4: Begin completions
// TYPE_CHECKED_EXPR_4-NEXT: Decl[InstanceVar]/CurrNominal: instanceVar[#Int#]{{$}}
// TYPE_CHECKED_EXPR_4-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc({#Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_4-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc({#(a): Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_4-NEXT: End completions

func resyncParser5() {}

fooObject.#^TYPE_CHECKED_EXPR_5^#.bar
// TYPE_CHECKED_EXPR_5: Begin completions
// TYPE_CHECKED_EXPR_5-NEXT: Decl[InstanceVar]/CurrNominal: instanceVar[#Int#]{{$}}
// TYPE_CHECKED_EXPR_5-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc({#Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_5-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc({#(a): Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_5-NEXT: End completions

func resyncParser6() {}
Expand All @@ -135,7 +135,7 @@ var fooObjectWithErrorInInit : FooStruct = unknown_var
fooObjectWithErrorInInit.#^TYPE_CHECKED_EXPR_WITH_ERROR_IN_INIT_1^#
// TYPE_CHECKED_EXPR_WITH_ERROR_IN_INIT_1: Begin completions
// TYPE_CHECKED_EXPR_WITH_ERROR_IN_INIT_1-NEXT: Decl[InstanceVar]/CurrNominal: instanceVar[#Int#]{{$}}
// TYPE_CHECKED_EXPR_WITH_ERROR_IN_INIT_1-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc({#Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_WITH_ERROR_IN_INIT_1-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc({#(a): Int#})[#Void#]{{$}}
// TYPE_CHECKED_EXPR_WITH_ERROR_IN_INIT_1-NEXT: End completions

func resyncParser6a() {}
Expand Down Expand Up @@ -168,7 +168,7 @@ func resyncParser8() {}

// PLAIN_TOP_LEVEL_NO_DUPLICATES: Begin completions
// PLAIN_TOP_LEVEL_NO_DUPLICATES-DAG: Decl[FreeFunction]/CurrModule: fooFunc1()[#Void#]{{$}}
// PLAIN_TOP_LEVEL_NO_DUPLICATES-DAG: Decl[FreeFunction]/CurrModule: fooFunc2({#Int#}, {#Double#})[#Void#]{{$}}
// PLAIN_TOP_LEVEL_NO_DUPLICATES-DAG: Decl[FreeFunction]/CurrModule: fooFunc2({#(a): Int#}, {#(b): Double#})[#Void#]{{$}}
// PLAIN_TOP_LEVEL_NO_DUPLICATES-NOT: fooFunc1
// PLAIN_TOP_LEVEL_NO_DUPLICATES-NOT: fooFunc2
// PLAIN_TOP_LEVEL_NO_DUPLICATES: End completions
Expand Down
Loading

0 comments on commit a268024

Please sign in to comment.