Skip to content

Commit 69d22da

Browse files
committed
Format SwiftLanguageServer.swift
1 parent 59cc291 commit 69d22da

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,16 @@ extension SwiftLanguageServer {
389389
// Sleep for a little bit until triggering the diagnostic generation. This effectively de-bounces diagnostic
390390
// generation since any later edit will cancel the previous in-flight task, which will thus never go on to send
391391
// 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+
)
393395
} catch {
394396
return
395397
}
396398
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+
)
398402

399403
await sourceKitServer.sendNotificationToClient(
400404
PublishDiagnosticsNotification(
@@ -404,10 +408,12 @@ extension SwiftLanguageServer {
404408
)
405409
} catch is CancellationError {
406410
} catch {
407-
logger.fault("""
411+
logger.fault(
412+
"""
408413
Failed to get diagnostics
409414
\(error.forLogging)
410-
""")
415+
"""
416+
)
411417
}
412418
}
413419
}
@@ -1178,7 +1184,9 @@ extension SwiftLanguageServer {
11781184
return try await .full(fullDocumentDiagnosticReport(req))
11791185
}
11801186

1181-
private func fullDocumentDiagnosticReport(_ req: DocumentDiagnosticsRequest) async throws -> RelatedFullDocumentDiagnosticReport {
1187+
private func fullDocumentDiagnosticReport(
1188+
_ req: DocumentDiagnosticsRequest
1189+
) async throws -> RelatedFullDocumentDiagnosticReport {
11821190
guard let snapshot = documentManager.latestSnapshot(req.textDocument.uri) else {
11831191
throw ResponseError.unknown("failed to find snapshot for url \(req.textDocument.uri.forLogging)")
11841192
}

0 commit comments

Comments
 (0)