Skip to content

Commit 37b98af

Browse files
benlangmuirrjmccall
authored andcommitted
[CodeCompletion] Pre-expand closures in argument completion
When completing a single argument for a trailing closure, pre-expand the closure expression syntax instead of using a placeholder. It's not valid to pass a non-closure anyway. rdar://62189182
1 parent 2bf014d commit 37b98af

10 files changed

+168
-29
lines changed

include/swift/IDE/CodeCompletion.h

+7
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ class CodeCompletionStringChunk {
156156
/// closure type if CallParameterType is a TypeAliasType.
157157
CallParameterClosureType,
158158

159+
/// An expanded closure expression for the value of a parameter, including
160+
/// the left and right braces and possible signature. The preferred
161+
/// position to put the cursor after the completion result is inserted
162+
/// into the editor buffer is between the braces.
163+
CallParameterClosureExpr,
164+
159165
/// A placeholder for \c ! or \c ? in a call to a method found by dynamic
160166
/// lookup.
161167
///
@@ -224,6 +230,7 @@ class CodeCompletionStringChunk {
224230
Kind == ChunkKind::DeclAttrParamKeyword ||
225231
Kind == ChunkKind::CallParameterType ||
226232
Kind == ChunkKind::CallParameterClosureType ||
233+
Kind == ChunkKind::CallParameterClosureExpr ||
227234
Kind == ChunkKind::GenericParameterName ||
228235
Kind == ChunkKind::DynamicLookupMethodCallTail ||
229236
Kind == ChunkKind::OptionalMethodCallTail ||

lib/IDE/CodeCompletion.cpp

+62-9
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ void CodeCompletionString::print(raw_ostream &OS) const {
431431
OS << C.getText();
432432
OS << "#]";
433433
break;
434+
case ChunkKind::CallParameterClosureExpr:
435+
OS << " {" << C.getText() << "|}";
436+
break;
434437
case ChunkKind::BraceStmtWithCursor:
435438
OS << " {|}";
436439
break;
@@ -870,7 +873,8 @@ void CodeCompletionResultBuilder::addCallParameter(Identifier Name,
870873
bool IsInOut,
871874
bool IsIUO,
872875
bool isAutoClosure,
873-
bool useUnderscoreLabel) {
876+
bool useUnderscoreLabel,
877+
bool isLabeledTrailingClosure) {
874878
CurrentNestingLevel++;
875879
using ChunkKind = CodeCompletionString::Chunk::ChunkKind;
876880

@@ -967,7 +971,8 @@ void CodeCompletionResultBuilder::addCallParameter(Identifier Name,
967971
// function type.
968972
Ty = Ty->lookThroughAllOptionalTypes();
969973
if (auto AFT = Ty->getAs<AnyFunctionType>()) {
970-
// If this is a closure type, add ChunkKind::CallParameterClosureType.
974+
// If this is a closure type, add ChunkKind::CallParameterClosureType or
975+
// ChunkKind::CallParameterClosureExpr for labeled trailing closures.
971976
PrintOptions PO;
972977
PO.PrintFunctionRepresentationAttrs =
973978
PrintOptions::FunctionRepresentationMode::None;
@@ -976,9 +981,51 @@ void CodeCompletionResultBuilder::addCallParameter(Identifier Name,
976981
PrintOptions::OpaqueReturnTypePrintingMode::WithoutOpaqueKeyword;
977982
if (ContextTy)
978983
PO.setBaseType(ContextTy);
979-
addChunkWithText(
980-
CodeCompletionString::Chunk::ChunkKind::CallParameterClosureType,
981-
AFT->getString(PO));
984+
985+
if (isLabeledTrailingClosure) {
986+
// Expand the closure body.
987+
SmallString<32> buffer;
988+
llvm::raw_svector_ostream OS(buffer);
989+
990+
bool returnsVoid = AFT->getResult()->isVoid();
991+
bool hasSignature = !returnsVoid || !AFT->getParams().empty();
992+
if (hasSignature)
993+
OS << "(";
994+
bool firstParam = true;
995+
for (const auto &param : AFT->getParams()) {
996+
if (!firstParam)
997+
OS << ", ";
998+
firstParam = false;
999+
1000+
if (param.hasLabel()) {
1001+
OS << param.getLabel();
1002+
} else {
1003+
OS << "<#";
1004+
if (param.isInOut())
1005+
OS << "inout ";
1006+
OS << param.getPlainType()->getString(PO);
1007+
if (param.isVariadic())
1008+
OS << "...";
1009+
OS << "#>";
1010+
}
1011+
}
1012+
if (hasSignature)
1013+
OS << ")";
1014+
if (!returnsVoid)
1015+
OS << " -> " << AFT->getResult()->getString(PO);
1016+
1017+
if (hasSignature)
1018+
OS << " in";
1019+
1020+
addChunkWithText(
1021+
CodeCompletionString::Chunk::ChunkKind::CallParameterClosureExpr,
1022+
OS.str());
1023+
} else {
1024+
// Add the closure type.
1025+
addChunkWithText(
1026+
CodeCompletionString::Chunk::ChunkKind::CallParameterClosureType,
1027+
AFT->getString(PO));
1028+
}
9821029
}
9831030

9841031
if (IsVarArg)
@@ -1337,6 +1384,7 @@ Optional<unsigned> CodeCompletionString::getFirstTextChunkIndex(
13371384
case ChunkKind::DeclAttrParamColon:
13381385
case ChunkKind::CallParameterType:
13391386
case ChunkKind::CallParameterClosureType:
1387+
case ChunkKind::CallParameterClosureExpr:
13401388
case ChunkKind::OptionalBegin:
13411389
case ChunkKind::GenericParameterBegin:
13421390
case ChunkKind::DynamicLookupMethodCallTail:
@@ -1370,6 +1418,7 @@ void CodeCompletionString::getName(raw_ostream &OS) const {
13701418
switch (C.getKind()) {
13711419
case ChunkKind::TypeAnnotation:
13721420
case ChunkKind::CallParameterClosureType:
1421+
case ChunkKind::CallParameterClosureExpr:
13731422
case ChunkKind::DeclAttrParamColon:
13741423
case ChunkKind::OptionalMethodCallTail:
13751424
continue;
@@ -2523,7 +2572,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
25232572

25242573
Builder.addCallParameter(argName, bodyName, paramTy, contextTy,
25252574
isVariadic, isInOut, isIUO, isAutoclosure,
2526-
/*useUnderscoreLabel=*/false);
2575+
/*useUnderscoreLabel=*/false,
2576+
/*isLabeledTrailingClosure=*/false);
25272577

25282578
modifiedBuilder = true;
25292579
NeedComma = true;
@@ -4159,7 +4209,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
41594209
}
41604210

41614211
void addCallArgumentCompletionResults(
4162-
ArrayRef<PossibleParamInfo> ParamInfos) {
4212+
ArrayRef<PossibleParamInfo> ParamInfos,
4213+
bool isLabeledTrailingClosure = false) {
41634214
Type ContextType;
41644215
if (auto typeContext = CurrDeclContext->getInnermostTypeContext())
41654216
ContextType = typeContext->getDeclaredTypeInContext();
@@ -4175,7 +4226,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
41754226
Arg->getPlainType(), ContextType,
41764227
Arg->isVariadic(), Arg->isInOut(),
41774228
/*isIUO=*/false, Arg->isAutoClosure(),
4178-
/*useUnderscoreLabel=*/true);
4229+
/*useUnderscoreLabel=*/true,
4230+
isLabeledTrailingClosure);
41794231
auto Ty = Arg->getPlainType();
41804232
if (Arg->isInOut()) {
41814233
Ty = InOutType::get(Ty);
@@ -5926,7 +5978,8 @@ void CodeCompletionCallbacksImpl::doneParsing() {
59265978

59275979
bool allRequired = false;
59285980
if (!params.empty()) {
5929-
Lookup.addCallArgumentCompletionResults(params);
5981+
Lookup.addCallArgumentCompletionResults(
5982+
params, /*isLabeledTrailingClosure=*/true);
59305983
allRequired = llvm::all_of(
59315984
params, [](const PossibleParamInfo &P) { return P.IsRequired; });
59325985
}

lib/IDE/CodeCompletionResultBuilder.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,14 @@ class CodeCompletionResultBuilder {
378378

379379
void addCallParameter(Identifier Name, Identifier LocalName, Type Ty,
380380
Type ContextTy, bool IsVarArg, bool IsInOut, bool IsIUO,
381-
bool isAutoClosure, bool useUnderscoreLabel);
381+
bool isAutoClosure, bool useUnderscoreLabel,
382+
bool isLabeledTrailingClosure);
382383

383384
void addCallParameter(Identifier Name, Type Ty, Type ContextTy = Type()) {
384385
addCallParameter(Name, Identifier(), Ty, ContextTy,
385386
/*IsVarArg=*/false, /*IsInOut=*/false, /*isIUO=*/false,
386-
/*isAutoClosure=*/false, /*useUnderscoreLabel=*/false);
387+
/*isAutoClosure=*/false, /*useUnderscoreLabel=*/false,
388+
/*isLabeledTrailingClosure=*/false);
387389
}
388390

389391
void addGenericParameter(StringRef Name) {

lib/IDE/CodeCompletionResultPrinter.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ void swift::ide::printCodeCompletionResultDescription(
3939

4040
if (C.is(ChunkKind::TypeAnnotation) ||
4141
C.is(ChunkKind::CallParameterClosureType) ||
42+
C.is(ChunkKind::CallParameterClosureExpr) ||
4243
C.is(ChunkKind::Whitespace))
4344
continue;
4445

@@ -117,6 +118,7 @@ class AnnotatingDescriptionPrinter {
117118
break;
118119
case ChunkKind::TypeAnnotation:
119120
case ChunkKind::CallParameterClosureType:
121+
case ChunkKind::CallParameterClosureExpr:
120122
case ChunkKind::Whitespace:
121123
// ignore;
122124
break;

lib/IDE/REPLCodeCompletion.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ static std::string toInsertableString(CodeCompletionResult *Result) {
8383
case CodeCompletionString::Chunk::ChunkKind::TypeAnnotation:
8484
return Str;
8585

86+
case CodeCompletionString::Chunk::ChunkKind::CallParameterClosureExpr:
87+
Str += " {";
88+
Str += C.getText();
89+
break;
8690
case CodeCompletionString::Chunk::ChunkKind::BraceStmtWithCursor:
8791
Str += " {";
8892
break;

test/IDE/complete_multiple_trailingclosure.swift

+16-16
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ func testGlobalFunc() {
2020
{ 1 } #^GLOBALFUNC_SAMELINE^#
2121
#^GLOBALFUNC_NEWLINE^#
2222
// GLOBALFUNC_SAMELINE: Begin completions, 1 items
23-
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
23+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
2424
// GLOBALFUNC_SAMELINE: End completions
2525

2626
// GLOBALFUNC_NEWLINE: Begin completions, 1 items
27-
// GLOBALFUNC_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
27+
// GLOBALFUNC_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
2828
// GLOBALFUNC_NEWLINE: End completions
2929

3030
globalFunc1()
@@ -49,14 +49,14 @@ func testMethod(value: MyStruct) {
4949
} #^METHOD_SAMELINE^#
5050
#^METHOD_NEWLINE^#
5151
// METHOD_SAMELINE: Begin completions, 4 items
52-
// METHOD_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: (() -> String)?##() -> String#}[#(() -> String)?#];
52+
// METHOD_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: (() -> String)? {() -> String in|}#}[#(() -> String)?#];
5353
// METHOD_SAMELINE-DAG: Decl[InstanceMethod]/CurrNominal: .enumFunc()[#Void#];
5454
// METHOD_SAMELINE-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: [' ']+ {#SimpleEnum#}[#SimpleEnum#];
5555
// METHOD_SAMELINE-DAG: Keyword[self]/CurrNominal: .self[#SimpleEnum#];
5656
// METHOD_SAMELINE: End completions
5757

5858
// METHOD_NEWLINE: Begin completions
59-
// METHOD_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: (() -> String)?##() -> String#}[#(() -> String)?#];
59+
// METHOD_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: (() -> String)? {() -> String in|}#}[#(() -> String)?#];
6060
// METHOD_NEWLINE-DAG: Keyword[class]/None: class;
6161
// METHOD_NEWLINE-DAG: Keyword[if]/None: if;
6262
// METHOD_NEWLINE-DAG: Keyword[try]/None: try;
@@ -80,15 +80,15 @@ func testOverloadedInit() {
8080
#^INIT_OVERLOADED_NEWLINE^#
8181

8282
// INIT_OVERLOADED_SAMELINE: Begin completions, 4 items
83-
// INIT_OVERLOADED_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
84-
// INIT_OVERLOADED_SAMELINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String##() -> String#}[#() -> String#];
83+
// INIT_OVERLOADED_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
84+
// INIT_OVERLOADED_SAMELINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String {() -> String in|}#}[#() -> String#];
8585
// INIT_OVERLOADED_SAMELINE-DAG: Decl[InstanceMethod]/CurrNominal: .testStructMethod()[#Void#];
8686
// INIT_OVERLOADED_SAMELINE-DAG: Keyword[self]/CurrNominal: .self[#TestStruct#];
8787
// INIT_OVERLOADED_SAMELINE: End completions
8888

8989
// INIT_OVERLOADED_NEWLINE: Begin completions
90-
// INIT_OVERLOADED_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
91-
// INIT_OVERLOADED_NEWLINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String##() -> String#}[#() -> String#];
90+
// INIT_OVERLOADED_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
91+
// INIT_OVERLOADED_NEWLINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String {() -> String in|}#}[#() -> String#];
9292
// INIT_OVERLOADED_NEWLINE-DAG: Keyword[class]/None: class;
9393
// INIT_OVERLOADED_NEWLINE-DAG: Keyword[if]/None: if;
9494
// INIT_OVERLOADED_NEWLINE-DAG: Keyword[try]/None: try;
@@ -107,15 +107,15 @@ func testOptionalInit() {
107107
#^INIT_OPTIONAL_NEWLINE^#
108108

109109
// INIT_OPTIONAL_SAMELINE: Begin completions, 4 items
110-
// INIT_OPTIONAL_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
111-
// INIT_OPTIONAL_SAMELINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String##() -> String#}[#() -> String#];
110+
// INIT_OPTIONAL_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
111+
// INIT_OPTIONAL_SAMELINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String {() -> String in|}#}[#() -> String#];
112112
// INIT_OPTIONAL_SAMELINE-DAG: Decl[InstanceMethod]/CurrNominal: .testStructMethod()[#Void#];
113113
// INIT_OPTIONAL_SAMELINE-DAG: Keyword[self]/CurrNominal: .self[#TestStruct2#];
114114
// INIT_OPTIONAL_SAMELINE: End completions
115115

116116
// INIT_OPTIONAL_NEWLINE: Begin completions
117-
// INIT_OPTIONAL_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
118-
// INIT_OPTIONAL_NEWLINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String##() -> String#}[#() -> String#];
117+
// INIT_OPTIONAL_NEWLINE-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
118+
// INIT_OPTIONAL_NEWLINE-DAG: Pattern/ExprSpecific: {#fn3: () -> String {() -> String in|}#}[#() -> String#];
119119
// INIT_OPTIONAL_NEWLINE-DAG: Keyword[class]/None: class;
120120
// INIT_OPTIONAL_NEWLINE-DAG: Keyword[if]/None: if;
121121
// INIT_OPTIONAL_NEWLINE-DAG: Keyword[try]/None: try;
@@ -135,11 +135,11 @@ func testOptionalInit() {
135135
#^INIT_REQUIRED_NEWLINE_1^#
136136

137137
// INIT_REQUIRED_SAMELINE_1: Begin completions, 1 items
138-
// INIT_REQUIRED_SAMELINE_1-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
138+
// INIT_REQUIRED_SAMELINE_1-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
139139
// INIT_REQUIRED_SAMELINE_1: End completions
140140

141141
// INIT_REQUIRED_NEWLINE_1: Begin completions, 1 items
142-
// INIT_REQUIRED_NEWLINE_1-DAG: Pattern/ExprSpecific: {#fn2: () -> String##() -> String#}[#() -> String#];
142+
// INIT_REQUIRED_NEWLINE_1-DAG: Pattern/ExprSpecific: {#fn2: () -> String {() -> String in|}#}[#() -> String#];
143143
// INIT_REQUIRED_NEWLINE_1: End completions
144144

145145
// missing 'fn3'.
@@ -151,11 +151,11 @@ func testOptionalInit() {
151151
#^INIT_REQUIRED_NEWLINE_2^#
152152

153153
// INIT_REQUIRED_SAMELINE_2: Begin completions, 1 items
154-
// INIT_REQUIRED_SAMELINE_2-DAG: Pattern/ExprSpecific: {#fn3: () -> String##() -> String#}[#() -> String#];
154+
// INIT_REQUIRED_SAMELINE_2-DAG: Pattern/ExprSpecific: {#fn3: () -> String {() -> String in|}#}[#() -> String#];
155155
// INIT_REQUIRED_SAMELINE_2: End completions
156156

157157
// INIT_REQUIRED_NEWLINE_2: Begin completions, 1 items
158-
// INIT_REQUIRED_NEWLINE_2-DAG: Pattern/ExprSpecific: {#fn3: () -> String##() -> String#}[#() -> String#];
158+
// INIT_REQUIRED_NEWLINE_2-DAG: Pattern/ExprSpecific: {#fn3: () -> String {() -> String in|}#}[#() -> String#];
159159
// INIT_REQUIRED_NEWLINE_2: End completions
160160

161161
// Call is completed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GLOBALFUNC_SAMELINE | %FileCheck %s -check-prefix=GLOBALFUNC_SAMELINE
2+
3+
func func1(
4+
fn1: () -> Int,
5+
fn2: () -> Void = {},
6+
fn3: (Int) -> Void = {_ in},
7+
fn4: (Int, String) -> Void = {_,_ in},
8+
fn5: (Int, String) -> Int = {_,_ in 1},
9+
fn6: (_ a: Int, _ b: String) -> Int = {_,_ in 1},
10+
fn7: (inout Int) -> Void = {_ in},
11+
fn8: (Int...) -> Void = { (_:Int...) in})
12+
{}
13+
14+
func test() {
15+
func1()
16+
{ 1 } #^GLOBALFUNC_SAMELINE^#
17+
18+
// GLOBALFUNC_SAMELINE: Begin completions
19+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn2: () -> Void {|}#}[#() -> Void#];
20+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn3: (Int) -> Void {(<#Int#>) in|}#}[#(Int) -> Void#];
21+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn4: (Int, String) -> Void {(<#Int#>, <#String#>) in|}#}[#(Int, String) -> Void#];
22+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn5: (Int, String) -> Int {(<#Int#>, <#String#>) -> Int in|}#}[#(Int, String) -> Int#];
23+
// FIXME: recover names
24+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn6: (Int, String) -> Int {(<#Int#>, <#String#>) -> Int in|}#}[#(Int, String) -> Int#];
25+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn7: (inout Int) -> Void {(<#inout Int#>) in|}#}[#(inout Int) -> Void#];
26+
// GLOBALFUNC_SAMELINE-DAG: Pattern/ExprSpecific: {#fn8: (Int...) -> Void {(<#Int...#>) in|}#}[#(Int...) -> Void#];
27+
// GLOBALFUNC_SAMELINE: End completions
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
func test() {
2+
func1()
3+
{ 1 }
4+
}
5+
6+
func func1(
7+
fn1: () -> Int,
8+
fn2: () -> Void = {},
9+
fn3: (Int) -> Void = {_ in},
10+
fn4: (Int, String) -> Void = {_,_ in},
11+
fn5: (Int, String) -> Int = {_,_ in 1},
12+
fn7: (inout Int) -> Void = {_ in},
13+
fn8: (Int...) -> Void = { (_:Int...) in})
14+
{}
15+
16+
// RUN: %sourcekitd-test -req=complete -pos=3:11 %s -- %s > %t
17+
// RUN: %FileCheck %s < %t
18+
// RUN: %FileCheck %s --check-prefix=DESCRIPTION < %t
19+
20+
// CHECK: key.results: [
21+
// CHECK-DAG: key.sourcetext: "fn2: {\n<#code#>\n}"
22+
// CHECK-DAG: key.sourcetext: "fn3: { (<#Int#>) in\n<#code#>\n}"
23+
// CHECK-DAG: key.sourcetext: "fn4: { (<#Int#>, <#String#>) in\n<#code#>\n}",
24+
// CHECK-DAG: key.sourcetext: "fn5: { (<#Int#>, <#String#>) -> Int in\n<#code#>\n}",
25+
// CHECK-DAG: key.sourcetext: "fn7: { (<#inout Int#>) in\n<#code#>\n}",
26+
// CHECK-DAG: key.sourcetext: "fn8: { (<#Int...#>) in\n<#code#>\n}",
27+
// CHECK: ]
28+
29+
// DESCRIPTION-NOT: key.description: "fn{{[0-9]*}}: {

tools/SourceKit/lib/SwiftLang/CodeCompletionOrganizer.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,7 @@ void CompletionBuilder::getFilterName(CodeCompletionString *str,
12311231
case ChunkKind::TypeAnnotation:
12321232
case ChunkKind::CallParameterInternalName:
12331233
case ChunkKind::CallParameterClosureType:
1234+
case ChunkKind::CallParameterClosureExpr:
12341235
case ChunkKind::CallParameterType:
12351236
case ChunkKind::DeclAttrParamColon:
12361237
case ChunkKind::Comma:

0 commit comments

Comments
 (0)