forked from swiftlang/swift-docc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDiagnosticConsumer.swift
27 lines (21 loc) · 1.05 KB
/
DiagnosticConsumer.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
This source file is part of the Swift.org open source project
Copyright (c) 2021-2023 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
import Foundation
/// A type that can receive diagnostics.
public protocol DiagnosticConsumer: AnyObject {
/// Receive diagnostics encountered by a ``DiagnosticEngine``.
/// - Parameter problems: The encountered diagnostics.
func receive(_ problems: [Problem])
/// Inform the consumer that the engine has sent all diagnostics for this build.
func finalize() throws
}
/// A type that can format received diagnostics in way that's suitable for writing to a destination such as a file or `TextOutputStream`.
public protocol DiagnosticFormattingConsumer: DiagnosticConsumer {
/// Options for how problems should be formatted if written to output.
var formattingOptions: DiagnosticFormattingOptions { get set }
}