Skip to content

Commit 2fe89a6

Browse files
committed
[CodeCompletion][NFC] Add some doc comments
(cherry picked from commit 56c531d)
1 parent 7579af5 commit 2fe89a6

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
@@ -5095,6 +5095,7 @@ namespace {
50955095
namespace {
50965096
using FunctionTypeAndDecl = std::pair<AnyFunctionType *, ValueDecl *>;
50975097

5098+
/// Collect function (or subscript) members with the given \p name on \p baseTy.
50985099
void collectPossibleCalleesByQualifiedLookup(
50995100
DeclContext &DC, Type baseTy, DeclBaseName name,
51005101
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5127,6 +5128,8 @@ void collectPossibleCalleesByQualifiedLookup(
51275128
}
51285129
}
51295130

5131+
/// Collect function (or subscript) members with the given \p name on
5132+
/// \p baseExpr expression.
51305133
void collectPossibleCalleesByQualifiedLookup(
51315134
DeclContext &DC, Expr *baseExpr, DeclBaseName name,
51325135
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5142,6 +5145,7 @@ void collectPossibleCalleesByQualifiedLookup(
51425145
collectPossibleCalleesByQualifiedLookup(DC, baseTy, name, candidates);
51435146
}
51445147

5148+
/// For the given \c callExpr, collect possible callee types and declarations.
51455149
bool collectPossibleCalleesForApply(
51465150
DeclContext &DC, ApplyExpr *callExpr,
51475151
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5187,6 +5191,8 @@ bool collectPossibleCalleesForApply(
51875191
return !candidates.empty();
51885192
}
51895193

5194+
/// For the given \c subscriptExpr, collect possible callee types and
5195+
/// declarations.
51905196
bool collectPossibleCalleesForSubscript(
51915197
DeclContext &DC, SubscriptExpr *subscriptExpr,
51925198
SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
@@ -5204,6 +5210,9 @@ bool collectPossibleCalleesForSubscript(
52045210
return !candidates.empty();
52055211
}
52065212

5213+
/// Get index of \p CCExpr in \p Args. \p Args is usually a \c TupleExpr,
5214+
/// \c ParenExpr, or a \c TupleShuffleExpr.
5215+
/// \returns \c true if success, \c false if \p CCExpr is not a part of \p Args.
52075216
bool getPositionInArgs(DeclContext &DC, Expr *Args, Expr *CCExpr,
52085217
unsigned &Position, bool &HasName) {
52095218
if (auto TSE = dyn_cast<TupleShuffleExpr>(Args))
@@ -5287,6 +5296,7 @@ class CodeCompletionTypeContextAnalyzer {
52875296
PossibleNames.push_back(name);
52885297
}
52895298

5299+
/// Collect context information at call argument position.
52905300
bool collectArgumentExpectation(DeclContext &DC, Expr *E, Expr *CCExpr) {
52915301
// Collect parameter lists for possible func decls.
52925302
SmallVector<FunctionTypeAndDecl, 2> Candidates;
@@ -5300,7 +5310,7 @@ class CodeCompletionTypeContextAnalyzer {
53005310
return false;
53015311
Arg = subscriptExpr->getIndex();
53025312
}
5303-
PossibleCallees.append(Candidates.begin(), Candidates.end());
5313+
PossibleCallees.assign(Candidates.begin(), Candidates.end());
53045314

53055315
// Determine the position of code completion token in call argument.
53065316
unsigned Position;

0 commit comments

Comments
 (0)