Skip to content

Commit c86341e

Browse files
authored
Merge pull request #78839 from rintaro/6.1-astprinter-interfacemode-rdar131726756
[6.1][ASTPrinter] Print SPI by default
2 parents f1be5c7 + a722648 commit c86341e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

include/swift/AST/PrintOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ struct PrintOptions {
194194
Package // prints package, SPI, and public/inlinable decls
195195
};
196196

197-
InterfaceMode InterfaceContentKind;
197+
InterfaceMode InterfaceContentKind = InterfaceMode::Private;
198198

199199
bool printPublicInterface() const {
200200
return InterfaceContentKind == InterfaceMode::Public;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@_spi(Hello)
2+
public struct World {}
3+
4+
// RUN: %sourcekitd-test -req=cursor -pos=2:15 %s -- %s | %FileCheck -check-prefix=CHECK %s
5+
// CHECK: source.lang.swift.decl.struct (2:15-2:20)
6+
// CHECK: <Declaration>@_spi(Hello) public struct World</Declaration>
7+
// CHECK: <decl.struct><syntaxtype.attribute.name>@_spi</syntaxtype.attribute.name>(Hello) <syntaxtype.keyword>public</syntaxtype.keyword> <syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>World</decl.name></decl.struct>

0 commit comments

Comments
 (0)