[Completion] Support multiple parameter specifiers

Allow consuming any parameter specifiers ahead of
the completion token when completion for the start
of a function parameter type.
This commit is contained in:
Hamish Knight
2024-06-21 22:29:56 +01:00
parent 25dedc8f3f
commit 3d57297f43
4 changed files with 42 additions and 19 deletions

View File

@@ -1238,7 +1238,7 @@ public:
if (next.isAny(tok::at_sign, tok::kw_inout, tok::l_paren,
tok::identifier, tok::l_square, tok::kw_Any,
tok::kw_Self, tok::kw__, tok::kw_var,
tok::kw_let))
tok::kw_let, tok::code_complete))
return true;
if (next.is(tok::oper_prefix) && next.getText() == "~")
@@ -1608,6 +1608,11 @@ public:
/// Whether we are at the start of a parameter name when parsing a parameter.
bool startsParameterName(bool isClosure);
/// Attempts to perform code completion for the possible start of a function
/// parameter type, returning the source location of the consumed completion
/// token, or a null location if there is no completion token.
SourceLoc tryCompleteFunctionParamTypeBeginning();
/// Parse a parameter-clause.
///
/// \verbatim