Skip to content

[TypeChecker] NFC: Revise comments for `{typeCheck, solve}ForCodeComp… #32426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Sema/CSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,8 @@ void ConstraintSystem::solveForCodeCompletion(
SolverState state(cs, FreeTypeVariableBinding::Disallow);

// Enable "diagnostic mode" by default, this means that
// solver would produce "fixed" solutions along side of
// valid ones, which helps code completion to rank choices.
// solver would produce "fixed" solutions alongside valid
// ones, which helps code completion to rank choices.
state.recordFixes = true;

cs.solveImpl(solutions);
Expand Down
7 changes: 3 additions & 4 deletions lib/Sema/ConstraintSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -4731,17 +4731,16 @@ class ConstraintSystem {
/// Construct and solve a system of constraints based on the given expression
/// and its contextual information.
///
/// This menthod is designed to be used for code completion which means that
/// This method is designed to be used for code completion which means that
/// it doesn't mutate given expression, even if there is a single valid
/// solution, and constraint solver is allowed to produce partially correct
/// solutions, such solutions can have any number of holes in them, alongside
/// with valid ones.
/// solutions. Such solutions can have any number of holes in them.
///
/// \param expr The expression involved in code completion.
///
/// \param DC The declaration context this expression is found in.
///
/// \param contextualType The type expression is being converted to.
/// \param contextualType The type \p expr is being converted to.
///
/// \param CTP When contextualType is specified, this indicates what
/// the conversion is doing.
Expand Down
8 changes: 4 additions & 4 deletions lib/Sema/TypeChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,10 @@ FunctionType *getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,
/// Type check the given expression and provide results back to code completion
/// via specified callback.
///
/// This menthod is designed to be used for code completion which means that
/// it doesn't mutate AST and constraint solver is allowed to produce partially
/// correct solutions, such solutions can have any number of holes in them,
/// alongside with valid ones.
/// This method is designed to be used for code completion which means that
/// it doesn't mutate given expression, even if there is a single valid
/// solution, and constraint solver is allowed to produce partially correct
/// solutions. Such solutions can have any number of holes in them.
void typeCheckForCodeCompletion(
Expr *expr, DeclContext *DC, Type contextualType, ContextualTypePurpose CTP,
llvm::function_ref<void(const constraints::Solution &)> callback);
Expand Down