Skip to content

Commit 32852af

Browse files
committed
Demote two log messages issued on the error level
Just two cases where we were logging an error that wasn’t strictly necessary and was just spamming the log at the high log levels.
1 parent e4d8331 commit 32852af

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
@@ -1764,7 +1764,7 @@ extension SourceKitLSPServer {
17641764
// `SwiftLanguageService` will always respond with `unsupported method`. Thus, only log such a failure instead of
17651765
// returning it to the client.
17661766
if indexBasedResponse.isEmpty {
1767-
return await orLog("Fallback definition request") {
1767+
return await orLog("Fallback definition request", level: .info) {
17681768
return try await languageService.definition(req)
17691769
}
17701770
}

Sources/SourceKitLSP/Swift/SyntacticTestIndex.swift

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

0 commit comments

Comments
 (0)