File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,39 @@ public class DiagnosticEngine {
21
21
public init ( ) {
22
22
}
23
23
24
+ private var consumersQueue = DispatchQueue (
25
+ label: " com.apple.SwiftSyntax.DiagnosticEngine.consumers " , attributes: . concurrent)
26
+ private var _consumers = [ DiagnosticConsumer] ( )
24
27
/// The list of consumers of the diagnostic passing through this engine.
25
- internal var consumers = [ DiagnosticConsumer] ( )
28
+ private var consumers : [ DiagnosticConsumer ] {
29
+ get {
30
+ consumersQueue. sync {
31
+ _consumers
32
+ }
33
+ }
26
34
27
- public private( set) var diagnostics = [ Diagnostic] ( )
35
+ set {
36
+ consumersQueue. async ( flags: . barrier) {
37
+ self . _consumers = newValue
38
+ }
39
+ }
40
+ }
41
+
42
+ private var diagnosticsQueue = DispatchQueue (
43
+ label: " com.apple.SwiftSyntax.DiagnosticEngine.diagnostics " , attributes: . concurrent)
44
+ private var _diagnostics = [ Diagnostic] ( )
45
+ public private( set) var diagnostics : [ Diagnostic ] {
46
+ get {
47
+ diagnosticsQueue. sync {
48
+ _diagnostics
49
+ }
50
+ }
51
+ set {
52
+ diagnosticsQueue. async ( flags: . barrier) {
53
+ self . _diagnostics = newValue
54
+ }
55
+ }
56
+ }
28
57
29
58
internal var needsLineColumn : Bool {
30
59
// Check if any consumer is interested in line and column.
You can’t perform that action at this time.
0 commit comments