@@ -259,6 +259,7 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks,
259259 void completePostfixExpr (CodeCompletionExpr *E, bool hasSpace) override ;
260260 void completeExprKeyPath (KeyPathExpr *KPE, SourceLoc DotLoc) override ;
261261
262+ void completeTypePossibleFunctionParamBeginning () override ;
262263 void completeTypeDeclResultBeginning () override ;
263264 void completeTypeBeginning () override ;
264265 void completeTypeSimpleOrComposition () override ;
@@ -430,6 +431,11 @@ void CodeCompletionCallbacksImpl::completePoundAvailablePlatform() {
430431 CurDeclContext = P.CurDeclContext ;
431432}
432433
434+ void CodeCompletionCallbacksImpl::completeTypePossibleFunctionParamBeginning () {
435+ Kind = CompletionKind::TypePossibleFunctionParamBeginning;
436+ CurDeclContext = P.CurDeclContext ;
437+ }
438+
433439void CodeCompletionCallbacksImpl::completeTypeDeclResultBeginning () {
434440 Kind = CompletionKind::TypeDeclResultBeginning;
435441 CurDeclContext = P.CurDeclContext ;
@@ -1058,6 +1064,12 @@ void CodeCompletionCallbacksImpl::addKeywords(CodeCompletionResultSink &Sink,
10581064 }
10591065 break ;
10601066
1067+ case CompletionKind::TypePossibleFunctionParamBeginning:
1068+ addKeyword (Sink, " inout" , CodeCompletionKeywordKind::kw_inout);
1069+ addKeyword (Sink, " borrowing" , CodeCompletionKeywordKind::None);
1070+ addKeyword (Sink, " consuming" , CodeCompletionKeywordKind::None);
1071+ addKeyword (Sink, " isolated" , CodeCompletionKeywordKind::None);
1072+ LLVM_FALLTHROUGH;
10611073 case CompletionKind::TypeBeginning:
10621074 addKeyword (Sink, " repeat" , CodeCompletionKeywordKind::None);
10631075 LLVM_FALLTHROUGH;
@@ -1262,6 +1274,7 @@ void swift::ide::postProcessCompletionResults(
12621274 // names at non-type name position are "rare".
12631275 if (result->getKind () == CodeCompletionResultKind::Declaration &&
12641276 result->getAssociatedDeclKind () == CodeCompletionDeclKind::Protocol &&
1277+ Kind != CompletionKind::TypePossibleFunctionParamBeginning &&
12651278 Kind != CompletionKind::TypeBeginning &&
12661279 Kind != CompletionKind::TypeSimpleOrComposition &&
12671280 Kind != CompletionKind::TypeSimpleBeginning &&
@@ -1755,6 +1768,7 @@ void CodeCompletionCallbacksImpl::doneParsing(SourceFile *SrcFile) {
17551768 break ;
17561769 }
17571770
1771+ case CompletionKind::TypePossibleFunctionParamBeginning:
17581772 case CompletionKind::TypeDeclResultBeginning:
17591773 case CompletionKind::TypeBeginning:
17601774 case CompletionKind::TypeSimpleOrComposition:
0 commit comments