Skip to content

Commit 56c531d

Browse files
committed
[CodeCompletion][NFC] Add some doc comments
1 parent c55d6ce commit 56c531d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4973,6 +4973,7 @@ namespace {
49734973
namespace {
49744974
using FunctionTypeAndDecl = std::pair<AnyFunctionType *, ValueDecl *>;
49754975

4976+
/// Collect function (or subscript) members with the given \p name on \p baseTy.
49764977
void collectPossibleCalleesByQualifiedLookup(
49774978
DeclContext &DC, Type baseTy, DeclBaseName name,
49784979
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5005,6 +5006,8 @@ void collectPossibleCalleesByQualifiedLookup(
50055006
}
50065007
}
50075008

5009+
/// Collect function (or subscript) members with the given \p name on
5010+
/// \p baseExpr expression.
50085011
void collectPossibleCalleesByQualifiedLookup(
50095012
DeclContext &DC, Expr *baseExpr, DeclBaseName name,
50105013
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5020,6 +5023,7 @@ void collectPossibleCalleesByQualifiedLookup(
50205023
collectPossibleCalleesByQualifiedLookup(DC, baseTy, name, candidates);
50215024
}
50225025

5026+
/// For the given \c callExpr, collect possible callee types and declarations.
50235027
bool collectPossibleCalleesForApply(
50245028
DeclContext &DC, ApplyExpr *callExpr,
50255029
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5065,6 +5069,8 @@ bool collectPossibleCalleesForApply(
50655069
return !candidates.empty();
50665070
}
50675071

5072+
/// For the given \c subscriptExpr, collect possible callee types and
5073+
/// declarations.
50685074
bool collectPossibleCalleesForSubscript(
50695075
DeclContext &DC, SubscriptExpr *subscriptExpr,
50705076
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5082,6 +5088,9 @@ bool collectPossibleCalleesForSubscript(
50825088
return !candidates.empty();
50835089
}
50845090

5091+
/// Get index of \p CCExpr in \p Args. \p Args is usually a \c TupleExpr,
5092+
/// \c ParenExpr, or a \c TupleShuffleExpr.
5093+
/// \returns \c true if success, \c false if \p CCExpr is not a part of \p Args.
50855094
bool getPositionInArgs(DeclContext &DC, Expr *Args, Expr *CCExpr,
50865095
unsigned &Position, bool &HasName) {
50875096
if (auto TSE = dyn_cast<TupleShuffleExpr>(Args))
@@ -5165,6 +5174,7 @@ class CodeCompletionTypeContextAnalyzer {
51655174
PossibleNames.push_back(name);
51665175
}
51675176

5177+
/// Collect context information at call argument position.
51685178
bool collectArgumentExpectation(DeclContext &DC, Expr *E, Expr *CCExpr) {
51695179
// Collect parameter lists for possible func decls.
51705180
SmallVector<FunctionTypeAndDecl, 2> Candidates;
@@ -5178,7 +5188,7 @@ class CodeCompletionTypeContextAnalyzer {
51785188
return false;
51795189
Arg = subscriptExpr->getIndex();
51805190
}
5181-
PossibleCallees.append(Candidates.begin(), Candidates.end());
5191+
PossibleCallees.assign(Candidates.begin(), Candidates.end());
51825192

51835193
// Determine the position of code completion token in call argument.
51845194
unsigned Position;

0 commit comments

Comments
 (0)