mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Support a narrow case for producing trailing closures directly
This adds a narrow special case in code-completion for control-flow-like methods such as DispatchQueue().sync that are () -> (), to add a new completion where the trailing closure is immediately expanded rather than having to invoke placeholder expansion as a second step. rdar://problem/26628804
This commit is contained in:
@@ -2131,43 +2131,6 @@ static inline bool computeTupleShuffle(TupleType *fromTuple,
|
||||
/// trailing closure.
|
||||
bool hasTrailingClosure(const ConstraintLocatorBuilder &locator);
|
||||
|
||||
/// A call argument or parameter.
|
||||
struct LLVM_LIBRARY_VISIBILITY CallArgParam {
|
||||
/// The type of the argument or parameter. For a variadic parameter,
|
||||
/// this is the element type.
|
||||
Type Ty;
|
||||
|
||||
// The label associated with the argument or parameter, if any.
|
||||
Identifier Label;
|
||||
|
||||
/// Whether the parameter has a default argument. Not valid for arguments.
|
||||
bool HasDefaultArgument = false;
|
||||
|
||||
/// Whether the parameter is variadic. Not valid for arguments.
|
||||
bool Variadic = false;
|
||||
|
||||
/// Whether the argument or parameter has a label.
|
||||
bool hasLabel() const { return !Label.empty(); }
|
||||
};
|
||||
|
||||
/// Break an argument type into an array of \c CallArgParams.
|
||||
///
|
||||
/// \param type The type to decompose.
|
||||
SmallVector<CallArgParam, 4> decomposeArgType(Type type);
|
||||
|
||||
/// Break a parameter type into an array of \c CallArgParams.
|
||||
///
|
||||
/// \param paramOwner The declaration that owns this parameter.
|
||||
/// \param level The level of parameters that are being decomposed.
|
||||
SmallVector<CallArgParam, 4> decomposeParamType(
|
||||
Type type,
|
||||
ValueDecl *paramOwner,
|
||||
unsigned level);
|
||||
|
||||
/// Turn a param list into a symbolic and printable representation that does not
|
||||
/// include the types, something like (: , b:, c:)
|
||||
std::string getParamListAsString(ArrayRef<CallArgParam> parameters);
|
||||
|
||||
/// Describes the arguments to which a parameter binds.
|
||||
/// FIXME: This is an awful data structure. We want the equivalent of a
|
||||
/// TinyPtrVector for unsigned values.
|
||||
|
||||
Reference in New Issue
Block a user