We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4409ff commit 4a86e81Copy full SHA for 4a86e81
Sources/SourceKitD/SourceKitDRegistry.swift
@@ -69,12 +69,20 @@ public final class SourceKitDRegistry {
69
lock.withLock {
70
let existing = active.removeValue(forKey: key)
71
if let existing = existing {
72
- assert(self.cemetary[key] == nil)
+ assert(self.cemetary[key]?.value == nil)
73
cemetary[key] = WeakSourceKitD(value: existing)
74
}
75
return existing
76
77
78
+
79
+ /// Remove all SourceKitD instances, including weak ones.
80
+ public func clear() {
81
+ lock.withLock {
82
+ active.removeAll()
83
+ cemetary.removeAll()
84
+ }
85
86
87
88
struct WeakSourceKitD {
0 commit comments