Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/CLI/renderer/TextTypeDocumentationRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ struct TextTypeDocumentationRenderer: Sendable {
let content = DocumentationContentRenderer(references: page.references)
let metadata = ([page.metadata.roleHeading] + page.metadata.modules.map(\.name))
.filter { !$0.isEmpty }.joined(separator: " · ")
var sections = [layout.heading(page.metadata.title, prominent: true) + "\n" + metadata]
var sections = [
layout.heading(page.metadata.title, prominent: true) + "\n" + metadata
+ "\nSymbol kind: " + page.metadata.symbolKind
]

let abstract = content.inlineText(page.abstract)
if !abstract.isEmpty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct AppleDocsCommandIntegrationTests {
let output = try runAppleDocs(arguments)

// -- Assert --
#expect(output.hasPrefix("String\n━━━━━━\nStructure · Swift\n"))
#expect(output.hasPrefix("String\n━━━━━━\nStructure · Swift\nSymbol kind: struct\n"))
#expect(output.contains("Declaration\n───────────"))
#expect(output.contains("│ @frozen struct String"))
#expect(output.contains("Overview\n────────"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct DefaultTypeDocumentationRendererTests {
MXHangDiagnostic
━━━━━━━━━━━━━━━━
Class · MetricKit
Symbol kind: class

A diagnostic report.
"""
Expand Down Expand Up @@ -68,6 +69,7 @@ struct DefaultTypeDocumentationRendererTests {
Package
━━━━━━━
Structure · PackageDescription
Symbol kind: struct

The Swift package manifest representation.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct TextTypeDocumentationRendererContentTests {
let output = TextTypeDocumentationRenderer().render(page)

// -- Assert --
#expect(output == "View\n━━━━\nProtocol · SwiftUI")
#expect(output == "View\n━━━━\nProtocol · SwiftUI\nSymbol kind: protocol")
}

@Test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct TextTypeDocumentationRendererTests {
MXHangDiagnostic
━━━━━━━━━━━━━━━━
Class · MetricKit
Symbol kind: class

An object representing a diagnostic report.

Expand Down Expand Up @@ -262,6 +263,6 @@ struct TextTypeDocumentationRendererTests {
let output = TextTypeDocumentationRenderer().render(page)

// -- Assert --
#expect(output == "String\n━━━━━━\nStructure · Swift")
#expect(output == "String\n━━━━━━\nStructure · Swift\nSymbol kind: struct")
}
}
Loading