Skip to content

Commit 9c13dbb

Browse files
authored
Merge pull request swiftlang#1420 from ahoppen/reduce-some-logging
Demote two log messages issued on the `error` level
2 parents 6eaa433 + 32852af commit 9c13dbb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ extension SourceKitLSPServer {
17781778
// `SwiftLanguageService` will always respond with `unsupported method`. Thus, only log such a failure instead of
17791779
// returning it to the client.
17801780
if indexBasedResponse.isEmpty {
1781-
return await orLog("Fallback definition request") {
1781+
return await orLog("Fallback definition request", level: .info) {
17821782
return try await languageService.definition(req)
17831783
}
17841784
}

Sources/SourceKitLSP/Swift/SyntacticTestIndex.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ actor SyntacticTestIndex {
179179
guard !removedFiles.contains(uri) else {
180180
return
181181
}
182+
guard FileManager.default.fileExists(atPath: url.path) else {
183+
// File no longer exists. Probably deleted since we scheduled it for indexing. Nothing to worry about.
184+
logger.info("Not indexing \(uri.forLogging) for tests because it does not exist")
185+
return
186+
}
182187
guard
183188
let fileModificationDate = try? FileManager.default.attributesOfItem(atPath: url.path)[.modificationDate]
184189
as? Date

0 commit comments

Comments
 (0)