@@ -588,6 +588,10 @@ extension SwiftPackageTool {
588
588
589
589
@Flag ( help: " Add symbols with SPI information to the symbol graph. " )
590
590
var includeSPISymbols = false
591
+
592
+ @Flag ( help: " Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal. " )
593
+ var extensionBlockSymbolBehavior : ExtensionBlockSymbolBehavior = . omitExtensionBlockSymbols
594
+
591
595
592
596
func run( _ swiftTool: SwiftTool ) throws {
593
597
// Build the current package.
@@ -604,6 +608,7 @@ extension SwiftPackageTool {
604
608
minimumAccessLevel: minimumAccessLevel,
605
609
skipInheritedDocs: skipInheritedDocs,
606
610
includeSPISymbols: includeSPISymbols,
611
+ emitExtensionBlockSymbols: extensionBlockSymbolBehavior == . emitExtensionBlockSymbols,
607
612
outputFormat: . json( pretty: prettyPrint)
608
613
)
609
614
@@ -624,6 +629,11 @@ extension SwiftPackageTool {
624
629
print ( " Files written to " , symbolGraphDirectory. pathString)
625
630
}
626
631
}
632
+
633
+ enum ExtensionBlockSymbolBehavior : String , EnumerableFlag {
634
+ case emitExtensionBlockSymbols
635
+ case omitExtensionBlockSymbols
636
+ }
627
637
628
638
struct DumpPackage : SwiftCommand {
629
639
static let configuration = CommandConfiguration (
@@ -1428,6 +1438,7 @@ final class PluginDelegate: PluginInvocationDelegate {
1428
1438
}
1429
1439
symbolGraphExtractor. skipInheritedDocs = true
1430
1440
symbolGraphExtractor. includeSPISymbols = options. includeSPI
1441
+ symbolGraphExtractor. emitExtensionBlockSymbols = options. emitExtensionBlocks
1431
1442
1432
1443
// Determine the output directory, and remove any old version if it already exists.
1433
1444
guard let package = packageGraph. package ( for: target) else {
0 commit comments