Skip to content

Commit

Permalink
Format gen_csharp_binding.ml with make format
Browse files Browse the repository at this point in the history
Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
  • Loading branch information
danilo-delbusso committed Sep 5, 2022
1 parent a3781bc commit e40bd1e
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions ocaml/sdk-gen/csharp/gen_csharp_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ and gen_exposed_field out_chan cls content =
(* ------------------- category: proxy classes *)
and gen_proxy protocol =
let all_methods =
classes |> List.map (gen_proxy_class_methods) |> List.concat
classes |> List.map gen_proxy_class_methods |> List.concat
in
match protocol with
| CommonFunctions.XmlRpc ->
Expand All @@ -888,10 +888,7 @@ and gen_proxy protocol =
; ("proxy_class_fields", `A (List.map proxy_field all_fields))
]
in
`O
[
("proxy_classes", `A (List.map json_class classes))
]
`O [("proxy_classes", `A (List.map json_class classes))]
| CommonFunctions.JsonRpc ->
let json_method x = `O [("client_method", `String x)] in
`O [("client_methods", `A (List.map json_method all_methods))]
Expand Down Expand Up @@ -919,8 +916,7 @@ and gen_proxy_class_methods {name; messages; _} =
overloads @ [records]

and gen_proxy_method classname message params =
let proxy_msg_name = proxy_msg_name classname message
in
let proxy_msg_name = proxy_msg_name classname message in
let paramsJsonWithTypes =
proxy_params ~with_types:true ~json:true message classname params
in
Expand Down Expand Up @@ -965,16 +961,15 @@ and gen_proxy_method classname message params =
\ {\n\
\ var converters = new List<JsonConverter> {%s};\n\
\ var serializer = CreateSerializer(converters);\n\
\ return Rpc<XenRef<Task>>(\"Async.%s.%s\", new \
JArray(%s), serializer);\n\
\ return Rpc<XenRef<Task>>(\"Async.%s.%s\", new JArray(%s), \
serializer);\n\
\ }" proxy_msg_name paramsJsonWithTypes
(String.concat ", " async_converters)
classname message.msg_name paramsJsonNoTypes
else
""
in
sync ^ async


and proxy_params ~with_types ~json message classname params =
let refParam =
Expand Down Expand Up @@ -1064,9 +1059,8 @@ and gen_maps' out_chan =
"%s\n\n\
using System;\n\
using System.Collections;\n\
using System.Collections.Generic;\n\
namespace XenAPI\n\
using System.Collections.Generic;\n\n\
\ namespace XenAPI\n\
{\n\
\ internal class Maps\n\
\ {" Licence.bsd_two_clause ;
Expand Down

0 comments on commit e40bd1e

Please sign in to comment.