Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove API that was deprecated during the 5.10 release #1029

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 1 addition & 4 deletions Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ public class NavigatorIndex {
/// Missing bundle identifier.
case missingBundleIdentifier

@available(*, deprecated, renamed: "missingBundleIdentifier", message: "Use 'missingBundleIdentifier' instead. This deprecated API will be removed after 6.0 is released")
case missingBundleIndentifier

/// A RenderNode has no title and won't be indexed.
case missingTitle(description: String)

Expand All @@ -76,7 +73,7 @@ public class NavigatorIndex {

public var errorDescription: String {
switch self {
case .missingBundleIdentifier, .missingBundleIndentifier:
case .missingBundleIdentifier:
return "A navigator index requires a bundle identifier, which is missing."
case .missingTitle:
return "The page has no valid title available."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ public final class DiagnosticConsoleWriter: DiagnosticFormattingConsumer {
self.diagnosticFormatter.finalize()
}

// This is deprecated but still necessary to implement.
@available(*, deprecated, renamed: "flush()", message: "Use 'flush()' instead. This deprecated API will be removed after 6.0 is released")
public func finalize() throws {
try flush()
}

private static func makeDiagnosticFormatter(
_ options: DiagnosticFormattingOptions,
baseURL: URL?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ public protocol DiagnosticConsumer: AnyObject {
/// - Parameter problems: The encountered diagnostics.
func receive(_ problems: [Problem])

/// Inform the consumer that the engine has sent all diagnostics for this build.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also update the copyright message for this file to 2024.

@available(*, deprecated, renamed: "flush()", message: "Use 'flush()' instead. This deprecated API will be removed after 6.0 is released")
func finalize() throws

/// Inform the consumer that the engine has sent all diagnostics in a given context.
func flush() throws
}
Expand All @@ -29,11 +25,3 @@ public protocol DiagnosticFormattingConsumer: DiagnosticConsumer {
/// Options for how problems should be formatted if written to output.
var formattingOptions: DiagnosticFormattingOptions { get set }
}

public extension DiagnosticConsumer {
// Deprecated for suppressing the warning emitted when calling `finalize()`
@available(*, deprecated, message: "This deprecated API will be removed after 6.0 is released")
func flush() throws {
try finalize()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ public final class DiagnosticEngine {
}
}

@available(*, deprecated, renamed: "flush()", message: "Use 'flush()' instead. This deprecated API will be removed after 6.0 is released")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: update the copyright message to 2024.

public func finalize() {
flush()
}

public func flush() {
workQueue.sync {
for consumer in self.consumers.sync({ $0.values }) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ public struct DefaultAvailability: Codable, Equatable {
/// The availability version state information, e.g unavailable
internal var versionInformation: VersionInformation

/// A string representation of the version for this platform.
@available(*, deprecated, message: "Use `introducedVersion` instead. This deprecated API will be removed after 6.0 is released", renamed: "introducedVersion")
public var platformVersion: String {
return introducedVersion ?? "0.0"
}

/// A string representation of the version for this platform
/// or nil if it's unavailable.
public var introducedVersion: String? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,4 @@ public struct RenderNodeVariantOverridesApplier {
private struct RenderNodeVariantsProxy: Codable {
var variantOverrides: VariantOverrides?
}

@available(*, deprecated, message: "This error is never raised. This deprecated API will be removed after 6.0 is released")
public enum Error: DescribedError {
case corruptedRenderNode
public var errorDescription: String {
switch self {
case .corruptedRenderNode:
return "Corrupted or malformed render node value."
}
}
}
}
4 changes: 0 additions & 4 deletions Sources/SwiftDocC/Semantics/Symbol/Symbol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,6 @@ extension Symbol {

/// The first variant of the symbol's platform, if available.
public var platformName: PlatformName? { platformNameVariants.firstValue }

/// The first variant of the symbol's extended module, if available
@available(*, deprecated, message: "Use 'extendedModuleVariants' instead. This deprecated API will be removed after 6.0 is released")
public var extendedModule: String? { extendedModuleVariants.firstValue }

/// Whether the first variant of the symbol is required in its context.
public var isRequired: Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ extension ConvertAction {
// into a dictionary. This will throw with a descriptive error upon failure.
let parsedPlatforms = try PlatformArgumentParser.parse(convert.platforms)

let additionalSymbolGraphFiles = (convert as _DeprecatedSymbolGraphFilesAccess).additionalSymbolGraphFiles + symbolGraphFiles(
in: convert.additionalSymbolGraphDirectory
)
let additionalSymbolGraphFiles = symbolGraphFiles(in: convert.additionalSymbolGraphDirectory)

let bundleDiscoveryOptions = BundleDiscoveryOptions(
fallbackDisplayName: convert.fallbackBundleDisplayName,
Expand Down Expand Up @@ -104,8 +102,3 @@ private func symbolGraphFiles(in directory: URL?) -> [URL] {
return subpaths.map { directory.appendingPathComponent($0) }
.filter { DocumentationBundleFileTypes.isSymbolGraphFile($0) }
}

private protocol _DeprecatedSymbolGraphFilesAccess {
var additionalSymbolGraphFiles: [URL] { get }
}
extension Docc.Convert: _DeprecatedSymbolGraphFilesAccess {}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ public struct DocumentationCatalogOption: DirectoryPathOption {
transform: URL.init(fileURLWithPath:))
public var url: URL?
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: update the copyright message to 2024.

@available(*, deprecated, renamed: "DocumentationCatalogOption", message: "Use 'DocumentationCatalogOption' instead. This deprecated API will be removed after 6.0 is released")
public typealias DocumentationBundleOption = DocumentationCatalogOption
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public struct DocumentationCoverageOptionsArgument: ParsableArguments {
valueName: "symbol-kind")
)
var summaryLevel: DocumentationCoverageLevel = .brief

@Option(help: .hidden)
@available(*, deprecated, renamed: "summaryLevel", message: "Use 'summaryLevel' instead. This deprecated API will be removed after 6.0 is released")
public var level: DocumentationCoverageLevel = .none

var effectiveSummaryLevel: DocumentationCoverageLevel {
guard experimentalDocumentationCoverage else {
Expand All @@ -69,19 +65,9 @@ public struct DocumentationCoverageOptionsArgument: ParsableArguments {
)
public var symbolKindFilter: [DocumentationCoverageOptions.KindFilterOptions.BitFlagRepresentation] = []

@Option(parsing: ArrayParsingStrategy.upToNextOption, help: .hidden)
@available(*, deprecated, renamed: "symbolKindFilter", message: "Use 'symbolKindFilter' instead. This deprecated API will be removed after 6.0 is released")
public var kinds: [DocumentationCoverageOptions.KindFilterOptions.BitFlagRepresentation] = []

@available(*, deprecated) // This deprecation silences the access of the deprecated `level` and `kind` options.
public mutating func validate() throws {
Docc.Convert.warnAboutDeprecatedOptionIfNeeded("level", message: "Use '--coverage-summary-level' instead.")
Docc.Convert.warnAboutDeprecatedOptionIfNeeded("kinds", message: "Use '--coverage-symbol-kind-filter' instead.")

if !ProcessInfo.processInfo.arguments.contains("--coverage-summary-level"), level != .none {
summaryLevel = level
}
symbolKindFilter.append(contentsOf: kinds)
}
}

Expand Down
Loading