@@ -39,6 +39,9 @@ struct DumpSymbolGraph: SwiftCommand {
39
39
40
40
@Flag ( help: " Add symbols with SPI information to the symbol graph. " )
41
41
var includeSPISymbols = false
42
+
43
+ @Flag ( help: " Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal. " )
44
+ var extensionBlockSymbolBehavior : ExtensionBlockSymbolBehavior = . omitExtensionBlockSymbols
42
45
43
46
func run( _ swiftTool: SwiftTool ) throws {
44
47
// Build the current package.
@@ -51,10 +54,12 @@ struct DumpSymbolGraph: SwiftCommand {
51
54
let symbolGraphExtractor = try SymbolGraphExtract (
52
55
fileSystem: swiftTool. fileSystem,
53
56
tool: swiftTool. getDestinationToolchain ( ) . getSymbolGraphExtract ( ) ,
57
+ observabilityScope: swiftTool. observabilityScope,
54
58
skipSynthesizedMembers: skipSynthesizedMembers,
55
59
minimumAccessLevel: minimumAccessLevel,
56
60
skipInheritedDocs: skipInheritedDocs,
57
61
includeSPISymbols: includeSPISymbols,
62
+ emitExtensionBlockSymbols: extensionBlockSymbolBehavior == . emitExtensionBlockSymbols,
58
63
outputFormat: . json( pretty: prettyPrint)
59
64
)
60
65
@@ -76,6 +81,11 @@ struct DumpSymbolGraph: SwiftCommand {
76
81
}
77
82
}
78
83
84
+ enum ExtensionBlockSymbolBehavior : String , EnumerableFlag {
85
+ case emitExtensionBlockSymbols
86
+ case omitExtensionBlockSymbols
87
+ }
88
+
79
89
struct DumpPackage : SwiftCommand {
80
90
static let configuration = CommandConfiguration (
81
91
abstract: " Print parsed Package.swift as JSON " )
0 commit comments