@@ -145,7 +145,7 @@ package actor SwiftLanguageService: LanguageService, Sendable {
145
145
146
146
private var stateChangeHandlers : [ ( _ oldState: LanguageServerState , _ newState: LanguageServerState ) -> Void ] = [ ]
147
147
148
- private var diagnosticReportManager : DiagnosticReportManager !
148
+ private let diagnosticReportManager : DiagnosticReportManager
149
149
150
150
var documentManager : DocumentManager {
151
151
get throws {
@@ -165,14 +165,6 @@ package actor SwiftLanguageService: LanguageService, Sendable {
165
165
/// request.
166
166
private let refreshDiagnosticsDebouncer : Debouncer < Void >
167
167
168
- /// Only exists to work around rdar://116221716.
169
- /// Once that is fixed, remove the property and make `diagnosticReportManager` non-optional.
170
- private var clientHasDiagnosticsCodeDescriptionSupport : Bool {
171
- get async {
172
- return await capabilityRegistry. clientHasDiagnosticsCodeDescriptionSupport
173
- }
174
- }
175
-
176
168
/// Creates a language server for the given client using the sourcekitd dylib specified in `toolchain`.
177
169
/// `reopenDocuments` is a closure that will be called if sourcekitd crashes and the `SwiftLanguageService` asks its
178
170
/// parent server to reopen all of its documents.
@@ -192,7 +184,6 @@ package actor SwiftLanguageService: LanguageService, Sendable {
192
184
self . semanticIndexManager = workspace. semanticIndexManager
193
185
self . testHooks = testHooks
194
186
self . state = . connected
195
- self . diagnosticReportManager = nil // Needed to work around rdar://116221716
196
187
self . options = options
197
188
198
189
// The debounce duration of 500ms was chosen arbitrarily without scientific research.
@@ -210,8 +201,8 @@ package actor SwiftLanguageService: LanguageService, Sendable {
210
201
sourcekitd: self . sourcekitd,
211
202
options: options,
212
203
syntaxTreeManager: syntaxTreeManager,
213
- documentManager: try documentManager,
214
- clientHasDiagnosticsCodeDescriptionSupport: await self . clientHasDiagnosticsCodeDescriptionSupport
204
+ documentManager: sourceKitLSPServer . documentManager,
205
+ clientHasDiagnosticsCodeDescriptionSupport: await capabilityRegistry . clientHasDiagnosticsCodeDescriptionSupport
215
206
)
216
207
217
208
// Create sub-directories for each type of generated file
0 commit comments