Skip to content

Commit b49a834

Browse files
authored
Merge pull request swiftlang#29127 from rintaro/ide-completion-underlinedkw-rdar56963545
[CodeCompletion] Stop printing underscored keyword in override completion
2 parents 1430c04 + ac7ba74 commit b49a834

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4265,6 +4265,7 @@ class CompletionOverrideLookup : public swift::VisibleDeclConsumer {
42654265
PrintOptions Options;
42664266
if (auto transformType = CurrDeclContext->getDeclaredTypeInContext())
42674267
Options.setBaseType(transformType);
4268+
Options.SkipUnderscoredKeywords = true;
42684269
Options.PrintImplicitAttrs = false;
42694270
Options.ExclusiveAttrList.push_back(TAK_escaping);
42704271
Options.ExclusiveAttrList.push_back(TAK_autoclosure);

test/IDE/complete_from_stdlib.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INFIX_STRING_1 | %FileCheck %s -check-prefix=INFIX_STRING
6767
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INFIX_EXT_STRING_1 | %FileCheck %s -check-prefix=INFIX_EXT_STRING
6868

69+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONFORM_SEQUENCE | %FileCheck %s -check-prefix=CONFORM_SEQUENCE
70+
6971
// NO_STDLIB_PRIVATE: Begin completions
7072
// NO_STDLIB_PRIVATE: End completions
7173

@@ -286,3 +288,14 @@ func testInfixOperator4(_ x: String) {
286288
// INFIX_EXT_STRING-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: && {#Bool#}[#Bool#]
287289
// INFIX_EXT_STRING-NOT: ==
288290
// INFIX_EXT_STRING: End completions
291+
292+
class TestSequence : Sequence {
293+
#^CONFORM_SEQUENCE^#
294+
// CONFORM_SEQUENCE: Begin completions
295+
// CONFORM_SEQUENCE-DAG: Decl[AssociatedType]/Super: typealias Element = {#(Type)#};
296+
// CONFORM_SEQUENCE-DAG: Decl[AssociatedType]/Super: typealias Iterator = {#(Type)#};
297+
// CONFORM_SEQUENCE-DAG: Decl[InstanceMethod]/Super: func makeIterator() -> some IteratorProtocol {|};
298+
// CONFORM_SEQUENCE-DAG: Decl[InstanceVar]/Super: var underestimatedCount: Int;
299+
// CONFORM_SEQUENCE-DAG: Decl[InstanceMethod]/Super: func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Element>) throws -> R) rethrows -> R? {|};
300+
// CONFORM_SEQUENCE: End completions
301+
}

0 commit comments

Comments
 (0)