Skip to content

Commit 0dad5ff

Browse files
committed
[NFC][CodeCompletion] Prepend 'should' to 'addItemWithoutDefaultArgs'
Rename 'addItemWithoutDefaultArgs' to 'shouldAddItemWithoutDefaultArg' because this function only returns bool indicating "should or not".
1 parent cd4bc88 commit 0dad5ff

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/swift/IDE/CompletionLookup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
348348

349349
static bool hasInterestingDefaultValue(const ParamDecl *param);
350350

351-
bool addItemWithoutDefaultArgs(const AbstractFunctionDecl *func);
351+
bool shouldAddItemWithoutDefaultArgs(const AbstractFunctionDecl *func);
352352

353353
/// Build argument patterns for calling. Returns \c true if any content was
354354
/// added to \p Builder. If \p declParams is non-empty, the size must match

lib/IDE/CompletionLookup.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ bool CompletionLookup::hasInterestingDefaultValue(const ParamDecl *param) {
894894
}
895895
}
896896

897-
bool CompletionLookup::addItemWithoutDefaultArgs(
897+
bool CompletionLookup::shouldAddItemWithoutDefaultArgs(
898898
const AbstractFunctionDecl *func) {
899899
if (!func || !Sink.addCallWithNoDefaultArgs)
900900
return false;
@@ -1189,7 +1189,7 @@ void CompletionLookup::addFunctionCallPattern(
11891189
if (isImplicitlyCurriedInstanceMethod) {
11901190
addPattern({AFD->getImplicitSelfDecl()}, /*includeDefaultArgs=*/true);
11911191
} else {
1192-
if (addItemWithoutDefaultArgs(AFD))
1192+
if (shouldAddItemWithoutDefaultArgs(AFD))
11931193
addPattern(AFD->getParameters()->getArray(),
11941194
/*includeDefaultArgs=*/false);
11951195
addPattern(AFD->getParameters()->getArray(),
@@ -1385,7 +1385,7 @@ void CompletionLookup::addMethodCall(const FuncDecl *FD,
13851385
if (trivialTrailingClosure)
13861386
addMethodImpl(/*includeDefaultArgs=*/false,
13871387
/*trivialTrailingClosure=*/true);
1388-
if (addItemWithoutDefaultArgs(FD))
1388+
if (shouldAddItemWithoutDefaultArgs(FD))
13891389
addMethodImpl(/*includeDefaultArgs=*/false);
13901390
addMethodImpl(/*includeDefaultArgs=*/true);
13911391
}
@@ -1475,7 +1475,7 @@ void CompletionLookup::addConstructorCall(const ConstructorDecl *CD,
14751475
}
14761476
};
14771477

1478-
if (ConstructorType && addItemWithoutDefaultArgs(CD))
1478+
if (ConstructorType && shouldAddItemWithoutDefaultArgs(CD))
14791479
addConstructorImpl(/*includeDefaultArgs=*/false);
14801480
addConstructorImpl();
14811481
}

0 commit comments

Comments
 (0)