mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user