@@ -13,6 +13,7 @@ import Markdown
13
13
import SymbolKit
14
14
15
15
/// A type that provides information about documentation bundles and their content.
16
+ @available ( * , deprecated, message: " Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released " )
16
17
public protocol DocumentationContextDataProvider {
17
18
/// An object to notify when bundles are added or removed.
18
19
var delegate : DocumentationContextDataProviderDelegate ? { get set }
@@ -31,6 +32,7 @@ public protocol DocumentationContextDataProvider {
31
32
}
32
33
33
34
/// An object that responds to changes in available documentation bundles for a specific provider.
35
+ @available ( * , deprecated, message: " Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released " )
34
36
public protocol DocumentationContextDataProviderDelegate : AnyObject {
35
37
36
38
/// Called when the `dataProvider` has added a new documentation bundle to its list of `bundles`.
@@ -79,7 +81,7 @@ public typealias BundleIdentifier = String
79
81
/// - ``children(of:kind:)``
80
82
/// - ``parents(of:)``
81
83
///
82
- public class DocumentationContext : DocumentationContextDataProviderDelegate {
84
+ public class DocumentationContext {
83
85
84
86
/// An error that's encountered while interacting with a ``SwiftDocC/DocumentationContext``.
85
87
public enum ContextError : DescribedError {
@@ -114,12 +116,14 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
114
116
public var linkResolver : LinkResolver
115
117
116
118
private enum _Provider {
119
+ @available ( * , deprecated, message: " Use 'DataProvider' instead. This deprecated API will be removed after 6.2 is released " )
117
120
case legacy( DocumentationContextDataProvider )
118
121
case new( DataProvider )
119
122
}
120
123
private var dataProvider : _Provider
121
124
122
125
/// The provider of documentation bundles for this context.
126
+ @available ( * , deprecated, message: " Use 'DataProvider' instead. This deprecated API will be removed after 6.2 is released " )
123
127
private var _legacyDataProvider : DocumentationContextDataProvider ! {
124
128
get {
125
129
switch dataProvider {
@@ -284,6 +288,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
284
288
/// - diagnosticEngine: The pre-configured engine that will collect problems encountered during compilation.
285
289
/// - configuration: A collection of configuration for the created context.
286
290
/// - Throws: If an error is encountered while registering a documentation bundle.
291
+ @available ( * , deprecated, message: " Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released " )
287
292
public init (
288
293
dataProvider: DocumentationContextDataProvider ,
289
294
diagnosticEngine: DiagnosticEngine = . init( ) ,
@@ -330,6 +335,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
330
335
/// - Parameters:
331
336
/// - dataProvider: The provider that added this bundle.
332
337
/// - bundle: The bundle that was added.
338
+ @available ( * , deprecated, message: " Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released " )
333
339
public func dataProvider( _ dataProvider: DocumentationContextDataProvider , didAddBundle bundle: DocumentationBundle ) throws {
334
340
try benchmark ( wrap: Benchmark . Duration ( id: " bundle-registration " ) ) {
335
341
// Enable reference caching for this documentation bundle.
@@ -344,6 +350,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
344
350
/// - Parameters:
345
351
/// - dataProvider: The provider that removed this bundle.
346
352
/// - bundle: The bundle that was removed.
353
+ @available ( * , deprecated, message: " Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released " )
347
354
public func dataProvider( _ dataProvider: DocumentationContextDataProvider , didRemoveBundle bundle: DocumentationBundle ) throws {
348
355
linkResolver. localResolver? . unregisterBundle ( identifier: bundle. identifier)
349
356
@@ -3054,3 +3061,6 @@ extension DataAsset {
3054
3061
}
3055
3062
}
3056
3063
}
3064
+
3065
+ @available ( * , deprecated, message: " This deprecated API will be removed after 6.2 is released " )
3066
+ extension DocumentationContext : DocumentationContextDataProviderDelegate { }
0 commit comments