Skip to content

Commit

Permalink
fix: refined orLog usage
Browse files Browse the repository at this point in the history
  • Loading branch information
louisunlimited committed Jun 27, 2024
1 parent ecdea04 commit 8596b21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/SourceKitLSP/Swift/SwiftLanguageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ extension SwiftLanguageService {
cancelInFlightPublishDiagnosticsTask(for: notification.textDocument.uri)
await diagnosticReportManager.removeItemsFromCache(with: notification.textDocument.uri)

guard let snapshot = try? self.documentManager.open(notification) else {
guard let snapshot = orLog("Getting document manager", { try self.documentManager.open(notification) }) else {
// Already logged failure.
return
}
Expand All @@ -454,8 +454,8 @@ extension SwiftLanguageService {
inFlightPublishDiagnosticsTasks[notification.textDocument.uri] = nil
await diagnosticReportManager.removeItemsFromCache(with: notification.textDocument.uri)

orLog("Connection to the editor closed") {
try? self.documentManager.close(notification)
orLog("Getting document manager") {
try self.documentManager.close(notification)
}

let req = closeDocumentSourcekitdRequest(uri: notification.textDocument.uri)
Expand Down Expand Up @@ -550,7 +550,7 @@ extension SwiftLanguageService {
let replacement: String
}

guard let (preEditSnapshot, postEditSnapshot, edits) = try? self.documentManager.edit(notification) else {
guard let (preEditSnapshot, postEditSnapshot, edits) = orLog("Getting document manager", { try self.documentManager.edit(notification) }) else {
return
}

Expand Down

0 comments on commit 8596b21

Please sign in to comment.