Skip to content

Commit c24f92d

Browse files
add documentation for certain functions
1 parent c37c596 commit c24f92d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Sources/DocCDocumentation/BuildSystemIntegrationExtensions.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ import SKLogging
1919
package extension BuildSystemManager {
2020
/// Retrieves the name of the Swift module for a given target.
2121
///
22+
/// **Note:** prefer using ``module(for:in:)`` over ths function. This function
23+
/// only exists for cases where you want the Swift module name of a target where
24+
/// you don't know one of its Swift document URIs in advance. E.g. when handling
25+
/// requests for Markdown/Tutorial files in DocC since they don't have compile
26+
/// commands that could be used to find the module name.
27+
///
2228
/// - Parameter target: The build target identifier
2329
/// - Returns: The name of the Swift module or nil if it could not be determined
2430
func moduleName(for target: BuildTargetIdentifier) async -> String? {

Sources/SourceKitLSP/Documentation/DoccDocumentationHandler.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ extension DocumentationLanguageService {
100100
}
101101
// This is a page representing the module itself.
102102
// Create a dummy symbol graph and tell SwiftDocC to convert the module name.
103+
// The version information isn't really all that important since we're creating
104+
// what is essentially an empty symbol graph.
103105
let emptySymbolGraph = String(
104106
data: try JSONEncoder().encode(
105107
SymbolGraph(
106108
metadata: SymbolGraph.Metadata(
107-
formatVersion: SymbolGraph.SemanticVersion(major: 0, minor: 5, patch: 0),
109+
formatVersion: SymbolGraph.SemanticVersion(major: 0, minor: 0, patch: 0),
108110
generator: "SourceKit-LSP"
109111
),
110112
module: SymbolGraph.Module(name: moduleName, platform: SymbolGraph.Platform()),

0 commit comments

Comments
 (0)