@@ -259,6 +259,7 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks,
259
259
void completePostfixExpr (CodeCompletionExpr *E, bool hasSpace) override ;
260
260
void completeExprKeyPath (KeyPathExpr *KPE, SourceLoc DotLoc) override ;
261
261
262
+ void completeTypePossibleFunctionParamBeginning () override ;
262
263
void completeTypeDeclResultBeginning () override ;
263
264
void completeTypeBeginning () override ;
264
265
void completeTypeSimpleOrComposition () override ;
@@ -430,6 +431,11 @@ void CodeCompletionCallbacksImpl::completePoundAvailablePlatform() {
430
431
CurDeclContext = P.CurDeclContext ;
431
432
}
432
433
434
+ void CodeCompletionCallbacksImpl::completeTypePossibleFunctionParamBeginning () {
435
+ Kind = CompletionKind::TypePossibleFunctionParamBeginning;
436
+ CurDeclContext = P.CurDeclContext ;
437
+ }
438
+
433
439
void CodeCompletionCallbacksImpl::completeTypeDeclResultBeginning () {
434
440
Kind = CompletionKind::TypeDeclResultBeginning;
435
441
CurDeclContext = P.CurDeclContext ;
@@ -1058,6 +1064,12 @@ void CodeCompletionCallbacksImpl::addKeywords(CodeCompletionResultSink &Sink,
1058
1064
}
1059
1065
break ;
1060
1066
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;
1061
1073
case CompletionKind::TypeBeginning:
1062
1074
addKeyword (Sink, " repeat" , CodeCompletionKeywordKind::None);
1063
1075
LLVM_FALLTHROUGH;
@@ -1262,6 +1274,7 @@ void swift::ide::postProcessCompletionResults(
1262
1274
// names at non-type name position are "rare".
1263
1275
if (result->getKind () == CodeCompletionResultKind::Declaration &&
1264
1276
result->getAssociatedDeclKind () == CodeCompletionDeclKind::Protocol &&
1277
+ Kind != CompletionKind::TypePossibleFunctionParamBeginning &&
1265
1278
Kind != CompletionKind::TypeBeginning &&
1266
1279
Kind != CompletionKind::TypeSimpleOrComposition &&
1267
1280
Kind != CompletionKind::TypeSimpleBeginning &&
@@ -1755,6 +1768,7 @@ void CodeCompletionCallbacksImpl::doneParsing(SourceFile *SrcFile) {
1755
1768
break ;
1756
1769
}
1757
1770
1771
+ case CompletionKind::TypePossibleFunctionParamBeginning:
1758
1772
case CompletionKind::TypeDeclResultBeginning:
1759
1773
case CompletionKind::TypeBeginning:
1760
1774
case CompletionKind::TypeSimpleOrComposition:
0 commit comments