Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rakaramos authored and mmatoszko committed Dec 30, 2018
1 parent 9ffd102 commit ef9e74b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/XiEditor/RPCSending.swift
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,20 @@ class StdoutRPCSender: RPCSending {
guard let jsonMethod = json["method"] as? String,
let params = json["params"],
let id = json["id"],
let method = RPCRequestMethod(rawValue: jsonMethod),
let args = params as? [[String: AnyObject]],
let result = client?.measureWidth(args: args)
let method = RPCRequestMethod(rawValue: jsonMethod)
else {
assertionFailure("unknown json from core: \(json)")
return
}

switch method {
case .measureWidth:
guard let args = params as? [[String: AnyObject]],
let result = client?.measureWidth(args: args) else {
assertionFailure("unexpected data from core: \(params)")
return
}

sendResult(id: id, result: result)
}
}
Expand Down

0 comments on commit ef9e74b

Please sign in to comment.