Skip to content

Demote two log messages issued on the error level #1420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SourceKitLSP/SourceKitLSPServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ extension SourceKitLSPServer {
// `SwiftLanguageService` will always respond with `unsupported method`. Thus, only log such a failure instead of
// returning it to the client.
if indexBasedResponse.isEmpty {
return await orLog("Fallback definition request") {
return await orLog("Fallback definition request", level: .info) {
return try await languageService.definition(req)
}
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/SourceKitLSP/Swift/SyntacticTestIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ actor SyntacticTestIndex {
guard !removedFiles.contains(uri) else {
return
}
guard FileManager.default.fileExists(atPath: url.path) else {
// File no longer exists. Probably deleted since we scheduled it for indexing. Nothing to worry about.
logger.info("Not indexing \(uri.forLogging) for tests because it does not exist")
return
}
guard
let fileModificationDate = try? FileManager.default.attributesOfItem(atPath: url.path)[.modificationDate]
as? Date
Expand Down