@@ -78,7 +78,7 @@ struct SymbolGraphLoader {
78
78
79
79
symbolGraphTransformer ? ( & symbolGraph)
80
80
81
- let ( moduleName, isMainSymbolGraph) = Self . moduleNameFor ( symbolGraph, at: symbolGraphURL)
81
+ let ( moduleName, isMainSymbolGraph) = GraphCollector . moduleNameFor ( symbolGraph, at: symbolGraphURL)
82
82
// If the bundle provides availability defaults add symbol availability data.
83
83
self . addDefaultAvailability ( to: & symbolGraph, moduleName: moduleName)
84
84
@@ -191,7 +191,7 @@ struct SymbolGraphLoader {
191
191
private func loadSymbolGraph( at url: URL ) throws -> ( SymbolGraph , isMainSymbolGraph: Bool ) {
192
192
// This is a private method, the `url` key is known to exist
193
193
var symbolGraph = symbolGraphs [ url] !
194
- let ( moduleName, isMainSymbolGraph) = Self . moduleNameFor ( symbolGraph, at: url)
194
+ let ( moduleName, isMainSymbolGraph) = GraphCollector . moduleNameFor ( symbolGraph, at: url)
195
195
196
196
if !isMainSymbolGraph && symbolGraph. module. bystanders == nil {
197
197
// If this is an extending another module, change the module name to match the extended module.
@@ -338,30 +338,6 @@ struct SymbolGraphLoader {
338
338
339
339
return fileName. split ( separator: " @ " , maxSplits: 1 ) . last. map ( { String ( $0) } )
340
340
}
341
-
342
- /// Returns the module name of a symbol graph based on the JSON data and file name.
343
- ///
344
- /// Useful during decoding the symbol graphs to implement the correct name logic starting with the module name in the JSON.
345
- private static func moduleNameFor( _ symbolGraph: SymbolGraph , at url: URL ) -> ( String , Bool ) {
346
- let isMainSymbolGraph = !url. lastPathComponent. contains ( " @ " )
347
-
348
- let moduleName : String
349
- if isMainSymbolGraph || symbolGraph. module. bystanders != nil {
350
- // For main symbol graphs, get the module name from the symbol graph's data
351
-
352
- // When bystander modules are present, the symbol graph is a cross-import overlay, and
353
- // we need to preserve the original module name to properly render it. It is still
354
- // kept with the extension symbols, due to the merging behavior of UnifiedSymbolGraph.
355
- moduleName = symbolGraph. module. name
356
- } else {
357
- // For extension symbol graphs, derive the extended module's name from the file name.
358
- //
359
- // The per-symbol `extendedModule` value is the same as the main module for most symbols, so it's not a good way to find the name
360
- // of the module that was extended (rdar://63200368).
361
- moduleName = SymbolGraphLoader . moduleNameFor ( url) !
362
- }
363
- return ( moduleName, isMainSymbolGraph)
364
- }
365
341
}
366
342
367
343
extension SymbolGraph . SemanticVersion {
0 commit comments