mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add repeat code completion
This commit is contained in:
@@ -1062,6 +1062,8 @@ void CodeCompletionCallbacksImpl::addKeywords(CodeCompletionResultSink &Sink,
|
||||
addSuperKeyword(Sink, CurDeclContext);
|
||||
addExprKeywords(Sink, CurDeclContext);
|
||||
addAnyTypeKeyword(Sink, CurDeclContext->getASTContext().TheAnyType);
|
||||
if (Kind == CompletionKind::ForEachSequence)
|
||||
addKeyword(Sink, "repeat", CodeCompletionKeywordKind::kw_repeat);
|
||||
break;
|
||||
|
||||
case CompletionKind::CallArg:
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=LOOP_5 | %FileCheck %s -check-prefix=LOOP_5
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=LOOP_6 | %FileCheck %s -check-prefix=LOOP_6
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=LOOP_7 | %FileCheck %s -check-prefix=LOOP_6
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=LOOP_8 | %FileCheck %s -check-prefix=LOOP_8
|
||||
|
||||
class Gen {
|
||||
func IntGen() -> Int { return 0 }
|
||||
@@ -80,3 +81,9 @@ do {
|
||||
}
|
||||
// LOOP_6: Begin completions, 1 items
|
||||
// LOOP_6-CHECK-NEXT: Keyword[in]/None: in; name=in
|
||||
|
||||
// Pack Iteration
|
||||
do {
|
||||
for t in #^LOOP_8^# {}
|
||||
}
|
||||
// LOOP_8-DAG: Keyword[repeat]/None: repeat; name=repeat
|
||||
|
||||
Reference in New Issue
Block a user