@@ -389,12 +389,16 @@ extension SwiftLanguageServer {
389
389
// Sleep for a little bit until triggering the diagnostic generation. This effectively de-bounces diagnostic
390
390
// generation since any later edit will cancel the previous in-flight task, which will thus never go on to send
391
391
// the `DocumentDiagnosticsRequest`.
392
- try await Task . sleep ( nanoseconds: UInt64 ( sourceKitServer. options. swiftPublishDiagnosticsDebounceDuration * 1_000_000_000 ) )
392
+ try await Task . sleep (
393
+ nanoseconds: UInt64 ( sourceKitServer. options. swiftPublishDiagnosticsDebounceDuration * 1_000_000_000 )
394
+ )
393
395
} catch {
394
396
return
395
397
}
396
398
do {
397
- let diagnosticReport = try await self . fullDocumentDiagnosticReport ( DocumentDiagnosticsRequest ( textDocument: TextDocumentIdentifier ( document) ) )
399
+ let diagnosticReport = try await self . fullDocumentDiagnosticReport (
400
+ DocumentDiagnosticsRequest ( textDocument: TextDocumentIdentifier ( document) )
401
+ )
398
402
399
403
await sourceKitServer. sendNotificationToClient (
400
404
PublishDiagnosticsNotification (
@@ -404,10 +408,12 @@ extension SwiftLanguageServer {
404
408
)
405
409
} catch is CancellationError {
406
410
} catch {
407
- logger. fault ( """
411
+ logger. fault (
412
+ """
408
413
Failed to get diagnostics
409
414
\( error. forLogging)
410
- """ )
415
+ """
416
+ )
411
417
}
412
418
}
413
419
}
@@ -1178,7 +1184,9 @@ extension SwiftLanguageServer {
1178
1184
return try await . full( fullDocumentDiagnosticReport ( req) )
1179
1185
}
1180
1186
1181
- private func fullDocumentDiagnosticReport( _ req: DocumentDiagnosticsRequest ) async throws -> RelatedFullDocumentDiagnosticReport {
1187
+ private func fullDocumentDiagnosticReport(
1188
+ _ req: DocumentDiagnosticsRequest
1189
+ ) async throws -> RelatedFullDocumentDiagnosticReport {
1182
1190
guard let snapshot = documentManager. latestSnapshot ( req. textDocument. uri) else {
1183
1191
throw ResponseError . unknown ( " failed to find snapshot for url \( req. textDocument. uri. forLogging) " )
1184
1192
}
0 commit comments