Merge Typing_logic.Coerce and Typing_logic.IsSubtype
[hiphop-php.git] / hphp / hack / src / client / clientSymbolInfo.ml
blobab26d947ead65d6be0e768f143a169c0d9ed8df1
1 (*
2 * Copyright (c) 2015, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 open Hh_prelude
12 let go
13 (conn : ClientConnect.conn)
14 ~(desc : string)
15 (files : string)
16 (expand_path : string -> string) : unit Lwt.t =
17 let file_list =
18 match files with
19 | "-" ->
20 let content = Sys_utils.read_stdin_to_string () in
21 Str.split (Str.regexp "\n") content
22 | _ -> Str.split (Str.regexp ";") files
24 let expand_path_list file_list =
25 List.rev_map file_list ~f:(fun file_path -> expand_path file_path)
27 let command =
28 ServerCommandTypes.DUMP_SYMBOL_INFO (expand_path_list file_list)
30 let%lwt (result, _telemetry) = ClientConnect.rpc conn ~desc command in
31 let result_json = ServerCommandTypes.Symbol_info_service.to_json result in
32 print_endline (Hh_json.json_to_string result_json);
33 Lwt.return_unit