use LSPResult instead of optional

This commit is contained in:
Richard Howell
2019-10-01 14:30:44 -07:00
parent c04e760ed9
commit e3fce37388
8 changed files with 63 additions and 46 deletions

View File

@@ -60,7 +60,9 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
/// We don't support change watching.
public func unregisterForChangeNotifications(for: URL) {}
public func buildTargets(reply: @escaping ([BuildTarget]?) -> Void) { reply(nil) }
public func buildTargets(reply: @escaping (LSPResult<[BuildTarget]>) -> Void) {
reply(.failure(buildTargetsNotSupported))
}
func database(for url: URL) -> CompilationDatabase? {
if let path = try? AbsolutePath(validating: url.path) {