mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
[compdb] Log only once per query on failure
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import SKSupport
|
||||
import Basic
|
||||
import LanguageServerProtocol
|
||||
|
||||
@@ -27,7 +28,7 @@ public final class CompilationDatabaseBuildSystem: BuildSettingsProvider {
|
||||
public init(projectRoot: AbsolutePath? = nil, fileSystem: FileSystem = localFileSystem) {
|
||||
self.fileSystem = fileSystem
|
||||
if let path = projectRoot {
|
||||
self.compdb = tryLoadCompilationDatabase(directory: path, fileSystem: fileSystem)
|
||||
self.compdb = tryLoadCompilationDatabase(directory: path, fileSystem)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,12 +54,17 @@ public final class CompilationDatabaseBuildSystem: BuildSettingsProvider {
|
||||
var dir = path
|
||||
while !dir.isRoot {
|
||||
dir = dir.parentDirectory
|
||||
if let db = tryLoadCompilationDatabase(directory: dir, fileSystem: fileSystem) {
|
||||
if let db = tryLoadCompilationDatabase(directory: dir, fileSystem) {
|
||||
compdb = db
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if compdb == nil {
|
||||
log("could not open compilation database for \(path.asString)", level: .warning)
|
||||
}
|
||||
|
||||
return compdb
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user