Skip to content

Commit de668ad

Browse files
committed
SymbolDataVariants -> DocumentationDataVariants
Since the SymbolDataVariants is now used beyond symbol APIs, this renames the type to something more generic. rdar://82967644
1 parent c470c5b commit de668ad

13 files changed

+173
-173
lines changed

Sources/SwiftDocC/Model/Identifier.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ public struct ResolvedTopicReference: Hashable, Codable, Equatable, CustomString
243243
var container = encoder.container(keyedBy: CodingKeys.self)
244244
try container.encode(url.absoluteString, forKey: .url)
245245

246-
let sourceLanguageIDVariants = SymbolDataVariants<String>(
247-
values: Dictionary<SymbolDataVariantsTrait, String>(
246+
let sourceLanguageIDVariants = DocumentationDataVariants<String>(
247+
values: Dictionary<DocumentationDataVariantsTrait, String>(
248248
uniqueKeysWithValues: sourceLanguages.map { language in
249-
(SymbolDataVariantsTrait(interfaceLanguage: language.id), language.id)
249+
(DocumentationDataVariantsTrait(interfaceLanguage: language.id), language.id)
250250
}
251251
)
252252
)

Sources/SwiftDocC/Model/Rendering/DocumentationContentRenderer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public class DocumentationContentRenderer {
243243
func renderReference(for reference: ResolvedTopicReference, with overridingDocumentationNode: DocumentationNode? = nil, dependencies: inout RenderReferenceDependencies) -> TopicRenderReference {
244244
let resolver = LinkTitleResolver(context: documentationContext, source: reference.url)
245245

246-
let titleVariants: SymbolDataVariants<String>
246+
let titleVariants: DocumentationDataVariants<String>
247247
let kind: RenderNode.Kind
248248
var referenceRole: String?
249249
let node = try? overridingDocumentationNode ?? documentationContext.entity(with: reference)

Sources/SwiftDocC/Model/Rendering/LinkTitleResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct LinkTitleResolver {
2626
///
2727
/// - Parameter page: The page for which to resolve the title.
2828
/// - Returns: The variants of the link title for this page, or `nil` if the page doesn't exist in the context.
29-
func title(for page: DocumentationNode) -> SymbolDataVariants<String>? {
29+
func title(for page: DocumentationNode) -> DocumentationDataVariants<String>? {
3030
if let bundle = context.bundle(identifier: page.reference.bundleIdentifier),
3131
let directive = page.markup.child(at: 0) as? BlockDirective {
3232

Sources/SwiftDocC/Model/Rendering/RenderSectionTranslator/DeclarationsSectionTranslator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct DeclarationsSectionTranslator: RenderSectionTranslator {
1818
renderNodeTranslator: inout RenderNodeTranslator
1919
) -> VariantCollection<CodableContentSection?>? {
2020
translateSectionToVariantCollection(
21-
symbolDataVariants: symbol.declarationVariants
21+
documentationDataVariants: symbol.declarationVariants
2222
) { trait, declaration -> RenderSection? in
2323
guard !declaration.isEmpty else {
2424
return nil

Sources/SwiftDocC/Model/Rendering/RenderSectionTranslator/DiscussionSectionTranslator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct DiscussionSectionTranslator: RenderSectionTranslator {
1919
renderNodeTranslator: inout RenderNodeTranslator
2020
) -> VariantCollection<CodableContentSection?>? {
2121
translateSectionToVariantCollection(
22-
symbolDataVariants: symbol.discussionVariants
22+
documentationDataVariants: symbol.discussionVariants
2323
) { _, discussion in
2424
guard let discussionContent = renderNodeTranslator.visitMarkupContainer(MarkupContainer(discussion.content)) as? [RenderBlockContent],
2525
!discussionContent.isEmpty

Sources/SwiftDocC/Model/Rendering/RenderSectionTranslator/ParametersSectionTranslator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct ParametersSectionTranslator: RenderSectionTranslator {
1818
renderNodeTranslator: inout RenderNodeTranslator
1919
) -> VariantCollection<CodableContentSection?>? {
2020
translateSectionToVariantCollection(
21-
symbolDataVariants: symbol.parametersSectionVariants
21+
documentationDataVariants: symbol.parametersSectionVariants
2222
) { _, parameters in
2323
guard !parameters.parameters.isEmpty else { return nil }
2424

Sources/SwiftDocC/Model/Rendering/RenderSectionTranslator/RenderSectionTranslator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ protocol RenderSectionTranslator {
2323
extension RenderSectionTranslator {
2424
/// Translates the variants of a piece of the given symbol into render node section variants.
2525
func translateSectionToVariantCollection<SymbolValue>(
26-
symbolDataVariants: SymbolDataVariants<SymbolValue>,
27-
transform: (SymbolDataVariantsTrait, SymbolValue) -> RenderSection?
26+
documentationDataVariants: DocumentationDataVariants<SymbolValue>,
27+
transform: (DocumentationDataVariantsTrait, SymbolValue) -> RenderSection?
2828
) -> VariantCollection<CodableContentSection?>? {
2929
VariantCollection<CodableContentSection?>(
30-
from: symbolDataVariants,
30+
from: documentationDataVariants,
3131
transform: { trait, value in
3232
transform(trait, value).map(CodableContentSection.init)
3333
}

Sources/SwiftDocC/Model/Rendering/RenderSectionTranslator/ReturnsSectionTranslator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct ReturnsSectionTranslator: RenderSectionTranslator {
1818
renderNodeTranslator: inout RenderNodeTranslator
1919
) -> VariantCollection<CodableContentSection?>? {
2020
translateSectionToVariantCollection(
21-
symbolDataVariants: symbol.returnsSectionVariants
21+
documentationDataVariants: symbol.returnsSectionVariants
2222
) { _, returns in
2323
guard !returns.content.isEmpty,
2424
let returnsContent = renderNodeTranslator.visitMarkupContainer(

0 commit comments

Comments
 (0)