Skip to content

Commit 43018c8

Browse files
committed
Add FIXME about future changes once other PRs are merged
1 parent 815e88c commit 43018c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/SwiftDocC/Model/Rendering/HTML/HTMLRenderer.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private struct ContextLinkProvider: DocCHTML.LinkProvider {
3939
// This symbol has multiple unique names
4040
let titles = [SourceLanguage: String](
4141
titles.map { trait, title in
42+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
4243
((trait.interfaceLanguage.map { SourceLanguage(id: $0) } ?? .swift), title)
4344
},
4445
uniquingKeysWith: { _, new in new }
@@ -92,6 +93,7 @@ private struct ContextLinkProvider: DocCHTML.LinkProvider {
9293
// This symbol has multiple unique names
9394
subheadings = .languageSpecificSymbol(.init(
9495
allSubheadings.map { trait, subheading in (
96+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
9597
key: (trait.interfaceLanguage.map { SourceLanguage(id: $0) } ?? .swift),
9698
value: convert(subheading)
9799
)},
@@ -293,6 +295,7 @@ struct HTMLRenderer {
293295
} else {
294296
names = .languageSpecificSymbol([SourceLanguage: String](
295297
symbol.titleVariants.allValues.compactMap({ trait, title in
298+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
296299
guard let languageID = trait.interfaceLanguage else { return nil }
297300
return (key: SourceLanguage(id: languageID), value: title)
298301
}),
@@ -314,6 +317,7 @@ struct HTMLRenderer {
314317
// Title
315318
let titleVariants = symbol.titleVariants.allValues.sorted(by: { $0.trait < $1.trait})
316319
for (trait, variant) in titleVariants {
320+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
317321
guard let lang = trait.interfaceLanguage else { continue }
318322

319323
var classes: [String] = []
@@ -371,6 +375,7 @@ struct HTMLRenderer {
371375

372376
var fragmentsByLanguageID = [SourceLanguage: [SymbolGraph.Symbol.DeclarationFragments.Fragment]]()
373377
for (trait, variant) in symbol.declarationVariants.allValues {
378+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
374379
guard let languageID = trait.interfaceLanguage else { continue }
375380
fragmentsByLanguageID[SourceLanguage(id: languageID)] = variant.values.first?.declarationFragments
376381
}
@@ -404,6 +409,7 @@ struct HTMLRenderer {
404409
renderer.parameters(
405410
.init(
406411
symbol.parametersSectionVariants.allValues.map { trait, parameters in (
412+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
407413
key: trait.interfaceLanguage.map { SourceLanguage(id: $0) } ?? .swift,
408414
value: parameters.parameters.map {
409415
.init(name: $0.name, content: $0.contents)
@@ -421,6 +427,7 @@ struct HTMLRenderer {
421427
renderer.returns(
422428
.init(
423429
symbol.returnsSectionVariants.allValues.map { trait, returnSection in (
430+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
424431
key: trait.interfaceLanguage.map { SourceLanguage(id: $0) } ?? .swift,
425432
value: returnSection.content
426433
)},
@@ -515,6 +522,7 @@ struct HTMLRenderer {
515522
// Note; this isn't a Comparable conformance because I wanted it to be private to this file.
516523
private extension DocumentationDataVariantsTrait {
517524
static func < (lhs: DocumentationDataVariantsTrait, rhs: DocumentationDataVariantsTrait) -> Bool {
525+
// FIXME: Use 'sourceLanguage' once https://github.com/swiftlang/swift-docc/pull/1355 is merged
518526
(lhs.interfaceLanguage ?? "") < (rhs.interfaceLanguage ?? "")
519527
}
520528
}

0 commit comments

Comments
 (0)