Skip to content

Commit 154cd88

Browse files
committed
[CodeCompletion] Use 'Flair' to describe "is argument labels"
1 parent 6dd5d94 commit 154cd88

36 files changed

+340
-356
lines changed

include/swift/IDE/CodeCompletion.h

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ enum class CodeCompletionFlairBit: uint8_t {
414414

415415
/// E.g. override func foo() { super.foo() ...
416416
SuperChain = 1 << 1,
417+
418+
/// Argument label and type. i.e. 'label: <#Ty#>'.
419+
ArgumentLabels = 1 << 2,
417420
};
418421

419422
using CodeCompletionFlair = OptionSet<CodeCompletionFlairBit>;
@@ -600,7 +603,6 @@ class CodeCompletionResult {
600603
unsigned KnownOperatorKind : 6;
601604
unsigned SemanticContext : 3;
602605
unsigned Flair: 8;
603-
unsigned IsArgumentLabels : 1;
604606
unsigned NotRecommended : 4;
605607
unsigned IsSystem : 1;
606608

@@ -625,16 +627,14 @@ class CodeCompletionResult {
625627
///
626628
/// \note The caller must ensure \c CodeCompletionString outlives this result.
627629
CodeCompletionResult(ResultKind Kind, SemanticContextKind SemanticContext,
628-
CodeCompletionFlair Flair,
629-
bool IsArgumentLabels, unsigned NumBytesToErase,
630+
CodeCompletionFlair Flair, unsigned NumBytesToErase,
630631
CodeCompletionString *CompletionString,
631632
ExpectedTypeRelation TypeDistance,
632633
CodeCompletionOperatorKind KnownOperatorKind =
633634
CodeCompletionOperatorKind::None,
634635
StringRef BriefDocComment = StringRef())
635636
: Kind(Kind), KnownOperatorKind(unsigned(KnownOperatorKind)),
636637
SemanticContext(unsigned(SemanticContext)), Flair(unsigned(Flair.toRaw())),
637-
IsArgumentLabels(unsigned(IsArgumentLabels)),
638638
NotRecommended(unsigned(NotRecommendedReason::None)),
639639
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
640640
BriefDocComment(BriefDocComment), TypeDistance(TypeDistance) {
@@ -655,13 +655,12 @@ class CodeCompletionResult {
655655
CodeCompletionResult(CodeCompletionKeywordKind Kind,
656656
SemanticContextKind SemanticContext,
657657
CodeCompletionFlair Flair,
658-
bool IsArgumentLabels, unsigned NumBytesToErase,
658+
unsigned NumBytesToErase,
659659
CodeCompletionString *CompletionString,
660660
ExpectedTypeRelation TypeDistance,
661661
StringRef BriefDocComment = StringRef())
662662
: Kind(Keyword), KnownOperatorKind(0),
663663
SemanticContext(unsigned(SemanticContext)), Flair(unsigned(Flair.toRaw())),
664-
IsArgumentLabels(unsigned(IsArgumentLabels)),
665664
NotRecommended(unsigned(NotRecommendedReason::None)),
666665
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
667666
BriefDocComment(BriefDocComment), TypeDistance(TypeDistance) {
@@ -675,13 +674,11 @@ class CodeCompletionResult {
675674
/// \note The caller must ensure \c CodeCompletionString outlives this result.
676675
CodeCompletionResult(CodeCompletionLiteralKind LiteralKind,
677676
SemanticContextKind SemanticContext,
678-
CodeCompletionFlair Flair,
679-
bool IsArgumentLabels, unsigned NumBytesToErase,
677+
CodeCompletionFlair Flair, unsigned NumBytesToErase,
680678
CodeCompletionString *CompletionString,
681679
ExpectedTypeRelation TypeDistance)
682680
: Kind(Literal), KnownOperatorKind(0),
683681
SemanticContext(unsigned(SemanticContext)), Flair(unsigned(Flair.toRaw())),
684-
IsArgumentLabels(unsigned(IsArgumentLabels)),
685682
NotRecommended(unsigned(NotRecommendedReason::None)),
686683
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
687684
TypeDistance(TypeDistance) {
@@ -696,8 +693,7 @@ class CodeCompletionResult {
696693
/// arguments outlive this result, typically by storing them in the same
697694
/// \c CodeCompletionResultSink as the result itself.
698695
CodeCompletionResult(SemanticContextKind SemanticContext,
699-
CodeCompletionFlair Flair,
700-
bool IsArgumentLabels, unsigned NumBytesToErase,
696+
CodeCompletionFlair Flair, unsigned NumBytesToErase,
701697
CodeCompletionString *CompletionString,
702698
const Decl *AssociatedDecl, StringRef ModuleName,
703699
CodeCompletionResult::NotRecommendedReason NotRecReason,
@@ -707,7 +703,6 @@ class CodeCompletionResult {
707703
enum ExpectedTypeRelation TypeDistance)
708704
: Kind(ResultKind::Declaration), KnownOperatorKind(0),
709705
SemanticContext(unsigned(SemanticContext)), Flair(unsigned(Flair.toRaw())),
710-
IsArgumentLabels(unsigned(IsArgumentLabels)),
711706
NotRecommended(unsigned(NotRecReason)),
712707
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
713708
ModuleName(ModuleName), BriefDocComment(BriefDocComment),
@@ -726,8 +721,7 @@ class CodeCompletionResult {
726721

727722
// Used by deserialization.
728723
CodeCompletionResult(SemanticContextKind SemanticContext,
729-
CodeCompletionFlair Flair,
730-
bool IsArgumentLabels, unsigned NumBytesToErase,
724+
CodeCompletionFlair Flair, unsigned NumBytesToErase,
731725
CodeCompletionString *CompletionString,
732726
CodeCompletionDeclKind DeclKind, bool IsSystem,
733727
StringRef ModuleName,
@@ -740,7 +734,6 @@ class CodeCompletionResult {
740734
: Kind(ResultKind::Declaration),
741735
KnownOperatorKind(unsigned(KnownOperatorKind)),
742736
SemanticContext(unsigned(SemanticContext)), Flair(unsigned(Flair.toRaw())),
743-
IsArgumentLabels(unsigned(IsArgumentLabels)),
744737
NotRecommended(unsigned(NotRecReason)), IsSystem(IsSystem),
745738
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
746739
ModuleName(ModuleName), BriefDocComment(BriefDocComment),
@@ -807,10 +800,6 @@ class CodeCompletionResult {
807800
return static_cast<CodeCompletionFlair>(Flair);
808801
}
809802

810-
bool isArgumentLabels() const {
811-
return static_cast<bool>(IsArgumentLabels);
812-
}
813-
814803
bool isNotRecommended() const {
815804
return getNotRecommendedReason() != NotRecommendedReason::None;
816805
}

lib/IDE/CodeCompletion.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ void CodeCompletionResult::printPrefix(raw_ostream &OS) const {
740740
}
741741
PRINT_FLAIR(ExpressionSpecific, "ExprSpecific");
742742
PRINT_FLAIR(SuperChain, "SuperChain");
743+
PRINT_FLAIR(ArgumentLabels, "ArgLabels");
743744
Prefix.append("]");
744745
}
745746
if (NotRecommended)
@@ -1304,7 +1305,7 @@ CodeCompletionResult *CodeCompletionResultBuilder::takeResult() {
13041305
}
13051306

13061307
return new (*Sink.Allocator) CodeCompletionResult(
1307-
SemanticContext, Flair, IsArgumentLabels, NumBytesToErase, CCS, AssociatedDecl,
1308+
SemanticContext, Flair, NumBytesToErase, CCS, AssociatedDecl,
13081309
ModuleName, NotRecReason, copyString(*Sink.Allocator, BriefComment),
13091310
copyAssociatedUSRs(*Sink.Allocator, AssociatedDecl),
13101311
copyArray(*Sink.Allocator, CommentWords), ExpectedTypeRelation);
@@ -1313,21 +1314,21 @@ CodeCompletionResult *CodeCompletionResultBuilder::takeResult() {
13131314
case CodeCompletionResult::ResultKind::Keyword:
13141315
return new (*Sink.Allocator)
13151316
CodeCompletionResult(
1316-
KeywordKind, SemanticContext, Flair, IsArgumentLabels, NumBytesToErase,
1317+
KeywordKind, SemanticContext, Flair, NumBytesToErase,
13171318
CCS, ExpectedTypeRelation,
13181319
copyString(*Sink.Allocator, BriefDocComment));
13191320

13201321
case CodeCompletionResult::ResultKind::BuiltinOperator:
13211322
case CodeCompletionResult::ResultKind::Pattern:
13221323
return new (*Sink.Allocator) CodeCompletionResult(
1323-
Kind, SemanticContext, Flair, IsArgumentLabels, NumBytesToErase, CCS,
1324+
Kind, SemanticContext, Flair, NumBytesToErase, CCS,
13241325
ExpectedTypeRelation, CodeCompletionOperatorKind::None,
13251326
copyString(*Sink.Allocator, BriefDocComment));
13261327

13271328
case CodeCompletionResult::ResultKind::Literal:
13281329
assert(LiteralKind.hasValue());
13291330
return new (*Sink.Allocator)
1330-
CodeCompletionResult(*LiteralKind, SemanticContext, Flair, IsArgumentLabels,
1331+
CodeCompletionResult(*LiteralKind, SemanticContext, Flair,
13311332
NumBytesToErase, CCS, ExpectedTypeRelation);
13321333
}
13331334

@@ -2883,10 +2884,14 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
28832884
Builder.setAssociatedDecl(SD);
28842885
setClangDeclKeywords(SD, Pairs, Builder);
28852886
}
2886-
if (!HaveLParen)
2887+
if (!HaveLParen) {
28872888
Builder.addLeftBracket();
2888-
else
2889+
} else {
2890+
// Add 'ArgumentLabels' only if it has '['. Without existing '[',
2891+
// consider it suggesting 'subscript' itself, not call arguments for it.
2892+
Builder.addFlair(CodeCompletionFlairBit::ArgumentLabels);
28892893
Builder.addAnnotatedLeftBracket();
2894+
}
28902895
ArrayRef<const ParamDecl *> declParams;
28912896
if (SD)
28922897
declParams = SD->getIndices()->getArray();
@@ -2920,7 +2925,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
29202925
: CodeCompletionResult::ResultKind::Pattern,
29212926
SemanticContext ? *SemanticContext : getSemanticContextKind(AFD),
29222927
expectedTypeContext);
2923-
Builder.setIsArgumentLabels();
2928+
Builder.addFlair(CodeCompletionFlairBit::ArgumentLabels);
29242929
if (AFD) {
29252930
Builder.setAssociatedDecl(AFD);
29262931
setClangDeclKeywords(AFD, Pairs, Builder);
@@ -3240,6 +3245,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
32403245
Builder.addBaseName("init");
32413246
} else if (!addName.empty()) {
32423247
Builder.addBaseName(addName.str());
3248+
} else {
3249+
Builder.addFlair(CodeCompletionFlairBit::ArgumentLabels);
32433250
}
32443251

32453252
if (!ConstructorType) {
@@ -4609,8 +4616,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
46094616
/*isIUO=*/false, Arg->isAutoClosure(),
46104617
/*useUnderscoreLabel=*/true,
46114618
isLabeledTrailingClosure);
4612-
Builder.setIsArgumentLabels();
4613-
Builder.addFlair(CodeCompletionFlairBit::ExpressionSpecific);
4619+
Builder.addFlair(CodeCompletionFlairBit::ArgumentLabels);
46144620
auto Ty = Arg->getPlainType();
46154621
if (Arg->isInOut()) {
46164622
Ty = InOutType::get(Ty);

lib/IDE/CodeCompletionCache.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,17 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
226226
}
227227

228228
CodeCompletionResult *result = nullptr;
229-
CodeCompletionFlair Flair;
230229
if (kind == CodeCompletionResult::Declaration) {
231230
result = new (*V.Sink.Allocator) CodeCompletionResult(
232-
context, Flair, /*IsArgumentLabels=*/false, numBytesToErase, string,
231+
context, CodeCompletionFlair(), numBytesToErase, string,
233232
declKind, isSystem, moduleName, notRecommended, briefDocComment,
234233
copyArray(*V.Sink.Allocator, ArrayRef<StringRef>(assocUSRs)),
235234
copyArray(*V.Sink.Allocator,
236235
ArrayRef<std::pair<StringRef, StringRef>>(declKeywords)),
237236
CodeCompletionResult::Unknown, opKind);
238237
} else {
239238
result = new (*V.Sink.Allocator)
240-
CodeCompletionResult(kind, context, Flair, /*IsArgumentLabels=*/false,
239+
CodeCompletionResult(kind, context, CodeCompletionFlair(),
241240
numBytesToErase, string,
242241
CodeCompletionResult::NotApplicable, opKind);
243242
}
@@ -342,7 +341,7 @@ static void writeCachedModule(llvm::raw_ostream &out,
342341
{
343342
endian::Writer LE(results, little);
344343
for (CodeCompletionResult *R : V.Sink.Results) {
345-
assert(!R->isArgumentLabels() && "Argument labels should not be cached");
344+
assert(!R->getFlair().toRaw() && "Any flairs should not be cached");
346345
assert(R->getNotRecommendedReason() !=
347346
CodeCompletionResult::NotRecommendedReason::InvalidAsyncContext &&
348347
"InvalidAsyncContext is decl context specific, cannot be cached");

lib/IDE/CodeCompletionResultBuilder.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class CodeCompletionResultBuilder {
8888
ExpectedTypeContext declTypeContext;
8989
CodeCompletionResult::ExpectedTypeRelation ExpectedTypeRelation =
9090
CodeCompletionResult::Unknown;
91-
bool IsArgumentLabels = false;
9291
bool Cancelled = false;
9392
ArrayRef<std::pair<StringRef, StringRef>> CommentWords;
9493
CodeCompletionResult::NotRecommendedReason NotRecReason =
@@ -160,10 +159,6 @@ class CodeCompletionResultBuilder {
160159
Flair |= Options;
161160
}
162161

163-
void setIsArgumentLabels(bool Flag = true) {
164-
IsArgumentLabels = Flag;
165-
}
166-
167162
void
168163
setExpectedTypeRelation(CodeCompletionResult::ExpectedTypeRelation relation) {
169164
ExpectedTypeRelation = relation;

test/IDE/complete_after_super.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ class SuperDerivedA : SuperBaseA {
145145
init (a: Float) {
146146
super.init#^CONSTRUCTOR_SUPER_INIT_1^#
147147
// CONSTRUCTOR_SUPER_INIT_1: Begin completions
148-
// CONSTRUCTOR_SUPER_INIT_1-DAG: Decl[Constructor]/CurrNominal: ()[#SuperBaseA#]; name=()
148+
// CONSTRUCTOR_SUPER_INIT_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ()[#SuperBaseA#]; name=()
149149
// CONSTRUCTOR_SUPER_INIT_1: End completions
150150
}
151151
init (b: Float) {
152152
super.init(#^CONSTRUCTOR_SUPER_INIT_PAREN_1^#
153153
// CONSTRUCTOR_SUPER_INIT_PAREN_1: Begin completions, 1 items
154-
// CONSTRUCTOR_SUPER_INIT_PAREN_1: Decl[Constructor]/CurrNominal: ['('][')'][#SuperBaseA#]; name=
154+
// CONSTRUCTOR_SUPER_INIT_PAREN_1: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['('][')'][#SuperBaseA#]; name=
155155
// CONSTRUCTOR_SUPER_INIT_PAREN_1: End completions
156156
}
157157

test/IDE/complete_annotation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func testArgument() -> MyStruct {
112112
foo(x: 1, #^CALLARG^#
113113
}
114114
// CALLARG: Begin completions, 1 items
115-
// CALLARG-DAG: Pattern/Local/Flair[ExprSpecific]: <callarg><callarg.label>y</callarg.label>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>; typename=<typeid.sys>Int</typeid.sys>
115+
// CALLARG-DAG: Pattern/Local/Flair[ArgLabels]: <callarg><callarg.label>y</callarg.label>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>; typename=<typeid.sys>Int</typeid.sys>
116116
// CALLARG: End completions
117117

118118
struct TestArchetypeAnnotations<T> {

test/IDE/complete_asyncannotation.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ struct HasAsyncMembers {
1919
func testGlobalFuncAsync() async {
2020
globalFuncAsync#^CHECK_globalFuncAsync^#
2121
// CHECK_globalFuncAsync: Begin completions
22-
// CHECK_globalFuncAsync-DAG: Decl[FreeFunction]/CurrModule: ()[' async'][#Void#]; name=() async
22+
// CHECK_globalFuncAsync-DAG: Decl[FreeFunction]/CurrModule/Flair[ArgLabels]: ()[' async'][#Void#]; name=() async
2323
// CHECK_globalFuncAsync: End completions
2424
}
2525
func testGlobalFuncAsyncThrows() async {
2626
globalFuncAsyncThrows#^CHECK_globalFuncAsyncThrows^#
2727
// CHECK_globalFuncAsyncThrows: Begin completions
28-
// CHECK_globalFuncAsyncThrows-DAG: Decl[FreeFunction]/CurrModule: ()[' async'][' throws'][#Void#]; name=() async throws
28+
// CHECK_globalFuncAsyncThrows-DAG: Decl[FreeFunction]/CurrModule/Flair[ArgLabels]: ()[' async'][' throws'][#Void#]; name=() async throws
2929
// CHECK_globalFuncAsyncThrows: End completions
3030
}
3131
func testGlobalFuncAsyncRethrows() async {
3232
globalFuncAsyncRethrows#^CHECK_globalFuncAsyncRethrows^#
3333
// CHECK_globalFuncAsyncRethrows: Begin completions
34-
// CHECK_globalFuncAsyncRethrows-DAG: Decl[FreeFunction]/CurrModule: ({#(x): () async throws -> ()##() async throws -> ()#})[' async'][' rethrows'][#Void#]; name=(x: () async throws -> ()) async rethrows
34+
// CHECK_globalFuncAsyncRethrows-DAG: Decl[FreeFunction]/CurrModule/Flair[ArgLabels]: ({#(x): () async throws -> ()##() async throws -> ()#})[' async'][' rethrows'][#Void#]; name=(x: () async throws -> ()) async rethrows
3535
// CHECK_globalFuncAsyncRethrows: End completions
3636
}
3737
func testAsyncMembers(_ x: HasAsyncMembers) async {
@@ -46,28 +46,28 @@ func testAsyncMembers(_ x: HasAsyncMembers) async {
4646
func testMemberAsync(_ x: HasAsyncMembers) async {
4747
x.memberAsync#^CHECK_memberAsync^#
4848
// CHECK_memberAsync: Begin completions
49-
// CHECK_memberAsync-DAG: Decl[InstanceMethod]/CurrNominal: ()[' async'][#Void#]; name=() async
49+
// CHECK_memberAsync-DAG: Decl[InstanceMethod]/CurrNominal/Flair[ArgLabels]: ()[' async'][#Void#]; name=() async
5050
// CHECK_memberAsync: End completions
5151
}
5252
func testMemberAsyncThrows(_ x: HasAsyncMembers) async {
5353
x.memberAsyncThrows#^CHECK_memberAsyncThrows^#
5454
// CHECK_memberAsyncThrows: Begin completions
55-
// CHECK_memberAsyncThrows-DAG: Decl[InstanceMethod]/CurrNominal: ()[' async'][' throws'][#Void#]; name=() async throws
55+
// CHECK_memberAsyncThrows-DAG: Decl[InstanceMethod]/CurrNominal/Flair[ArgLabels]: ()[' async'][' throws'][#Void#]; name=() async throws
5656
// CHECK_memberAsyncThrows: End completions
5757
}
5858
func testMemberAsyncRethrows(_ x: HasAsyncMembers) async {
5959
x.memberAsyncRethrows#^CHECK_memberAsyncRethrows^#
6060
// CHECK_memberAsyncRethrows: Begin completions
61-
// CHECK_memberAsyncRethrows-DAG: Decl[InstanceMethod]/CurrNominal: ({#(x): () async throws -> ()##() async throws -> ()#})[' async'][' rethrows'][#Void#]; name=(x: () async throws -> ()) async rethrows
61+
// CHECK_memberAsyncRethrows-DAG: Decl[InstanceMethod]/CurrNominal/Flair[ArgLabels]: ({#(x): () async throws -> ()##() async throws -> ()#})[' async'][' rethrows'][#Void#]; name=(x: () async throws -> ()) async rethrows
6262
// CHECK_memberAsyncRethrows: End completions
6363
}
6464

6565
func testAsyncIntiializers() async {
6666
HasAsyncMembers(#^CHECK_initializers^#
6767
// CHECK_initializers: Begin completions
68-
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['('][')'][' async'][#HasAsyncMembers#]; name= async
69-
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsync: Int#}[')'][' async'][#HasAsyncMembers#]; name=withAsync: Int async
70-
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsyncThrows: Int#}[')'][' async'][' throws'][#HasAsyncMembers#]; name=withAsyncThrows: Int async throws
71-
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsyncRethrows: () async throws -> Void##() async throws -> Void#}[')'][' async'][' rethrows'][#HasAsyncMembers#]; name=withAsyncRethrows: () async throws -> Void async rethrows
68+
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['('][')'][' async'][#HasAsyncMembers#]; name= async
69+
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#withAsync: Int#}[')'][' async'][#HasAsyncMembers#]; name=withAsync: Int async
70+
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#withAsyncThrows: Int#}[')'][' async'][' throws'][#HasAsyncMembers#]; name=withAsyncThrows: Int async throws
71+
// CHECK_initializers-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#withAsyncRethrows: () async throws -> Void##() async throws -> Void#}[')'][' async'][' rethrows'][#HasAsyncMembers#]; name=withAsyncRethrows: () async throws -> Void async rethrows
7272
// CHECK_initializers: End completions
7373
}

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: Decl[FreeFunction]/CurrModule: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
7+
// A-DAG: Decl[FreeFunction]/CurrModule/Flair[ArgLabels]: ['(']{#(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: 2 additions & 2 deletions
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: Decl[FreeFunction]/CurrModule: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
7+
// A-DAG: Decl[FreeFunction]/CurrModule/Flair[ArgLabels]: ['(']{#(x): Int#}[')'][#Void#]{{; name=.+$}}
88
// A: End completions
99
func f(_ x: Int) {}
10-
f(#^A^#
10+
f(#^A^#

0 commit comments

Comments
 (0)