Skip to content

Commit fc847a5

Browse files
committed
IDE: print underscored keywords for interface generation
Addressing @airspeedswift's code review feedback.
1 parent d9c3719 commit fc847a5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/swift/AST/PrintOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ struct PrintOptions {
449449
result.ShouldQualifyNestedDeclarations =
450450
QualifyNestedDeclarations::Always;
451451
result.PrintDocumentationComments = true;
452-
result.SkipUnderscoredKeywords = true;
453452
return result;
454453
}
455454

lib/IDE/IDETypeChecking.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ PrintOptions PrintOptions::printDocInterface() {
7777
result.PrintDocumentationComments = false;
7878
result.PrintRegularClangComments = false;
7979
result.PrintFunctionRepresentationAttrs = false;
80+
result.SkipUnderscoredKeywords = true;
8081
return result;
8182
}
8283

test/IDE/print_type_interface.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ extension D {
7171
// RUN: %target-swift-ide-test -print-type-interface -usr=_TtGSaSi_ -module-name print_type_interface -source-filename %s | %FileCheck %s -check-prefix=TYPE4
7272
// TYPE4-DAG: public typealias Index = Int
7373
// TYPE4-DAG: public func min() -> Int?
74-
// TYPE4-DAG: public mutating func insert<C>(contentsOf newElements: C, at i: Int)
74+
// TYPE4-DAG: public mutating func insert<C>(contentsOf newElements: __owned C, at i: Int)
7575
// TYPE4-DAG: public mutating func removeFirst(_ k: Int)
76-
// TYPE4-DAG: public func makeIterator() -> IndexingIterator<Array<Int>>
76+
// TYPE4-DAG: public __consuming func makeIterator() -> IndexingIterator<Array<Int>>
7777
// TYPE4-NOT: public func joined
7878

7979
// RUN: %target-swift-ide-test -print-type-interface -usr=_TtGSaSS_ -module-name print_type_interface -source-filename %s | %FileCheck %s -check-prefix=TYPE5
80-
// TYPE5-DAG: public func prefix(_ maxLength: Int) -> ArraySlice<String>
81-
// TYPE5-DAG: public func suffix(_ maxLength: Int) -> ArraySlice<String>
82-
// TYPE5-DAG: public func split(separator: String, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> [ArraySlice<String>]
80+
// TYPE5-DAG: public __consuming func prefix(_ maxLength: Int) -> ArraySlice<String>
81+
// TYPE5-DAG: public __consuming func suffix(_ maxLength: Int) -> ArraySlice<String>
82+
// TYPE5-DAG: public __consuming func split(separator: String, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> [ArraySlice<String>]
8383
// TYPE5-DAG: public func formIndex(_ i: inout Int, offsetBy distance: Int)
8484
// TYPE5-DAG: public func distance(from start: Int, to end: Int) -> Int
8585
// TYPE5-DAG: public func joined(separator: String = "") -> String

0 commit comments

Comments
 (0)