From 6c85c7f729260c9b472a2d1c1016b1201796c62f Mon Sep 17 00:00:00 2001 From: Pavel Yaskevich Date: Wed, 17 Jun 2020 00:05:57 -0700 Subject: [PATCH] [TypeChecker] NFC: Revise comments for `{typeCheck, solve}ForCodeCompletion` --- lib/Sema/CSSolver.cpp | 4 ++-- lib/Sema/ConstraintSystem.h | 7 +++---- lib/Sema/TypeChecker.h | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/Sema/CSSolver.cpp b/lib/Sema/CSSolver.cpp index d78f40af18fba..4bf720214dc00 100644 --- a/lib/Sema/CSSolver.cpp +++ b/lib/Sema/CSSolver.cpp @@ -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); diff --git a/lib/Sema/ConstraintSystem.h b/lib/Sema/ConstraintSystem.h index 526f998ba70ad..49aa7e3fdef47 100644 --- a/lib/Sema/ConstraintSystem.h +++ b/lib/Sema/ConstraintSystem.h @@ -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. diff --git a/lib/Sema/TypeChecker.h b/lib/Sema/TypeChecker.h index 56216cb3a8ebc..6b4a8a2eb31fe 100644 --- a/lib/Sema/TypeChecker.h +++ b/lib/Sema/TypeChecker.h @@ -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 callback);