Remove dependency from SourceKitLSP on swift-docc-symbolkit

This way all dependencies on the `docc` libraries are wrapped inside the `DocCDocumentation` module.
This commit is contained in:
Alex Hoppen
2025-04-23 18:02:34 +02:00
parent bbbc93ea01
commit 024efc2fa1
3 changed files with 18 additions and 17 deletions

View File

@@ -0,0 +1,17 @@
import Foundation
import SymbolKit
/// Generates a JSON string that represents an empty symbol graph for the given module name.
package func emptySymbolGraph(forModule moduleName: String) throws -> String? {
let symbolGraph = SymbolGraph(
metadata: SymbolGraph.Metadata(
formatVersion: SymbolGraph.SemanticVersion(major: 0, minor: 0, patch: 0),
generator: "SourceKit-LSP"
),
module: SymbolGraph.Module(name: moduleName, platform: SymbolGraph.Platform()),
symbols: [],
relationships: []
)
let data = try JSONEncoder().encode(symbolGraph)
return String(data: data, encoding: .utf8)
}