[code-completion] Add a new custom completion context for a for-each sequence

For normal completions it behaves the same as PostfixExprBeginning, but
it provides a hook for clients to provide a custom completion for this
position.  For example, you might want to a x ..< y snippet in this
position.

rdar://problem/29910383
This commit is contained in:
Ben Langmuir
2017-07-19 13:27:10 -07:00
parent 0c0532ac73
commit 93d22c9ff0
10 changed files with 51 additions and 0 deletions

View File

@@ -184,6 +184,12 @@ bool SourceKit::CodeCompletion::addCustomCompletions(
addCompletion(custom);
}
break;
case CompletionKind::ForEachSequence:
if (custom.Contexts.contains(CustomCompletionInfo::ForEachSequence)) {
changed = true;
addCompletion(custom);
}
break;
case CompletionKind::TypeSimpleBeginning:
if (custom.Contexts.contains(CustomCompletionInfo::Type)) {
changed = true;