mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
use LSPResult instead of optional
This commit is contained in:
@@ -173,12 +173,13 @@ extension BuildServerBuildSystem: BuildSystem {
|
||||
return nil
|
||||
}
|
||||
|
||||
public func buildTargets(reply: @escaping ([BuildTarget]?) -> Void) {
|
||||
_ = self.buildServer?.send(BuildTargets(), queue: requestQueue) { result in
|
||||
if let targets = result.success?.targets { reply(targets) }
|
||||
else {
|
||||
log("error fetching build targets: \(result)")
|
||||
reply(nil)
|
||||
public func buildTargets(reply: @escaping (LSPResult<[BuildTarget]>) -> Void) {
|
||||
_ = self.buildServer?.send(BuildTargets(), queue: requestQueue) { response in
|
||||
switch response {
|
||||
case .success(let result):
|
||||
reply(.success(result.targets))
|
||||
case .failure(let error):
|
||||
reply(.failure(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user