Skip to content

Commit 49c6c22

Browse files
authored
Remove unused property and parameter from generated doc topic code (#1265)
1 parent 9f464bc commit 49c6c22

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Sources/SwiftDocC/Infrastructure/Symbol Graph/GeneratedDocumentationTopics.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This source file is part of the Swift.org open source project
33

4-
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
4+
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
55
Licensed under Apache License v2.0 with Runtime Library Exception
66

77
See https://swift.org/LICENSE.txt for license information
@@ -27,8 +27,6 @@ enum GeneratedDocumentationTopics {
2727
struct APICollection {
2828
/// The title of the collection.
2929
var title: String
30-
/// A reference to the parent of the collection.
31-
let parentReference: ResolvedTopicReference
3230
/// A list of topic references for the collection.
3331
var identifiers = [ResolvedTopicReference]()
3432
}
@@ -39,8 +37,7 @@ enum GeneratedDocumentationTopics {
3937
/// - childReference: The inherited symbol reference.
4038
/// - reference: The parent type reference.
4139
/// - originDisplayName: The origin display name as provided by the symbol graph.
42-
/// - extendedModuleName: Extended module name.
43-
mutating func add(_ childReference: ResolvedTopicReference, to reference: ResolvedTopicReference, childSymbol: SymbolGraph.Symbol, originDisplayName: String, originSymbol: SymbolGraph.Symbol?, extendedModuleName: String) throws {
40+
mutating func add(_ childReference: ResolvedTopicReference, to reference: ResolvedTopicReference, childSymbol: SymbolGraph.Symbol, originDisplayName: String, originSymbol: SymbolGraph.Symbol?) throws {
4441
let fromType: String
4542
let typeSimpleName: String
4643
if let originSymbol, originSymbol.pathComponents.count > 1 {
@@ -89,7 +86,7 @@ enum GeneratedDocumentationTopics {
8986

9087
// Create a new default implementations provider, if needed.
9188
if !implementingTypes[reference]!.inheritedFromTypeName.keys.contains(fromType) {
92-
implementingTypes[reference]!.inheritedFromTypeName[fromType] = Collections.APICollection(title: "\(typeSimpleName) Implementations", parentReference: reference)
89+
implementingTypes[reference]!.inheritedFromTypeName[fromType] = Collections.APICollection(title: "\(typeSimpleName) Implementations")
9390
}
9491

9592
// Add the default implementation.
@@ -247,13 +244,13 @@ enum GeneratedDocumentationTopics {
247244
let child = context.documentationCache[relationship.source],
248245
// Get the child symbol
249246
let childSymbol = child.symbol,
250-
// Get the swift extension data
251-
let extends = childSymbol[mixin: SymbolGraph.Symbol.Swift.Extension.self]
247+
// Check that there is Swift extension information
248+
childSymbol[mixin: SymbolGraph.Symbol.Swift.Extension.self] != nil
252249
{
253250
let originSymbol = context.documentationCache[origin.identifier]?.symbol
254251

255252
// Add the inherited symbol to the index.
256-
try inheritanceIndex.add(child.reference, to: parent.reference, childSymbol: childSymbol, originDisplayName: origin.displayName, originSymbol: originSymbol, extendedModuleName: extends.extendedModule)
253+
try inheritanceIndex.add(child.reference, to: parent.reference, childSymbol: childSymbol, originDisplayName: origin.displayName, originSymbol: originSymbol)
257254
}
258255
}
259256

0 commit comments

Comments
 (0)