@@ -145,7 +145,7 @@ package actor SwiftLanguageService: LanguageService, Sendable {
145145
146146 private var stateChangeHandlers : [ ( _ oldState: LanguageServerState , _ newState: LanguageServerState ) -> Void ] = [ ]
147147
148- private var diagnosticReportManager : DiagnosticReportManager !
148+ private let diagnosticReportManager : DiagnosticReportManager
149149
150150 var documentManager : DocumentManager {
151151 get throws {
@@ -165,14 +165,6 @@ package actor SwiftLanguageService: LanguageService, Sendable {
165165 /// request.
166166 private let refreshDiagnosticsDebouncer : Debouncer < Void >
167167
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-
176168 /// Creates a language server for the given client using the sourcekitd dylib specified in `toolchain`.
177169 /// `reopenDocuments` is a closure that will be called if sourcekitd crashes and the `SwiftLanguageService` asks its
178170 /// parent server to reopen all of its documents.
@@ -192,7 +184,6 @@ package actor SwiftLanguageService: LanguageService, Sendable {
192184 self . semanticIndexManager = workspace. semanticIndexManager
193185 self . testHooks = testHooks
194186 self . state = . connected
195- self . diagnosticReportManager = nil // Needed to work around rdar://116221716
196187 self . options = options
197188
198189 // The debounce duration of 500ms was chosen arbitrarily without scientific research.
@@ -210,8 +201,8 @@ package actor SwiftLanguageService: LanguageService, Sendable {
210201 sourcekitd: self . sourcekitd,
211202 options: options,
212203 syntaxTreeManager: syntaxTreeManager,
213- documentManager: try documentManager,
214- clientHasDiagnosticsCodeDescriptionSupport: await self . clientHasDiagnosticsCodeDescriptionSupport
204+ documentManager: sourceKitLSPServer . documentManager,
205+ clientHasDiagnosticsCodeDescriptionSupport: await capabilityRegistry . clientHasDiagnosticsCodeDescriptionSupport
215206 )
216207
217208 // Create sub-directories for each type of generated file
0 commit comments