@@ -78,7 +78,7 @@ struct SymbolGraphLoader {
7878
7979 symbolGraphTransformer ? ( & symbolGraph)
8080
81- let ( moduleName, isMainSymbolGraph) = Self . moduleNameFor ( symbolGraph, at: symbolGraphURL)
81+ let ( moduleName, isMainSymbolGraph) = GraphCollector . moduleNameFor ( symbolGraph, at: symbolGraphURL)
8282 // If the bundle provides availability defaults add symbol availability data.
8383 self . addDefaultAvailability ( to: & symbolGraph, moduleName: moduleName)
8484
@@ -191,7 +191,7 @@ struct SymbolGraphLoader {
191191 private func loadSymbolGraph( at url: URL ) throws -> ( SymbolGraph , isMainSymbolGraph: Bool ) {
192192 // This is a private method, the `url` key is known to exist
193193 var symbolGraph = symbolGraphs [ url] !
194- let ( moduleName, isMainSymbolGraph) = Self . moduleNameFor ( symbolGraph, at: url)
194+ let ( moduleName, isMainSymbolGraph) = GraphCollector . moduleNameFor ( symbolGraph, at: url)
195195
196196 if !isMainSymbolGraph && symbolGraph. module. bystanders == nil {
197197 // If this is an extending another module, change the module name to match the extended module.
@@ -338,30 +338,6 @@ struct SymbolGraphLoader {
338338
339339 return fileName. split ( separator: " @ " , maxSplits: 1 ) . last. map ( { String ( $0) } )
340340 }
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- }
365341}
366342
367343extension SymbolGraph . SemanticVersion {
0 commit comments