mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ASTPrinter] Print SPI by default
`PrintOptions.InterfaceContentKind` was not initialized. Set it to
`InteraceMode::Private` by default, so SPI declarations and their `@_spi`
attribues are printed. This basically restores the behavior before
aba3b6c24e , and is align with
`AccessFilter` being `AccessLevel::Private` by default.
rdar://131726756
This commit is contained in:
@@ -194,7 +194,7 @@ struct PrintOptions {
|
||||
Package // prints package, SPI, and public/inlinable decls
|
||||
};
|
||||
|
||||
InterfaceMode InterfaceContentKind;
|
||||
InterfaceMode InterfaceContentKind = InterfaceMode::Private;
|
||||
|
||||
bool printPublicInterface() const {
|
||||
return InterfaceContentKind == InterfaceMode::Public;
|
||||
|
||||
7
test/SourceKit/CursorInfo/cursor_spi.swift
Normal file
7
test/SourceKit/CursorInfo/cursor_spi.swift
Normal file
@@ -0,0 +1,7 @@
|
||||
@_spi(Hello)
|
||||
public struct World {}
|
||||
|
||||
// RUN: %sourcekitd-test -req=cursor -pos=2:15 %s -- %s | %FileCheck -check-prefix=CHECK %s
|
||||
// CHECK: source.lang.swift.decl.struct (2:15-2:20)
|
||||
// CHECK: <Declaration>@_spi(Hello) public struct World</Declaration>
|
||||
// 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>
|
||||
Reference in New Issue
Block a user