Add type annotations to `clientConnect.ml`
[hiphop-php.git] / hphp / hack / src / server / serverIdeUtils.mli
blob0856eed939c563b1972471effd87bd13bff9bf54
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 *)
11 val make_local_changes: unit -> unit
12 val revert_local_changes: unit -> unit
13 (* When typechecking a content buffer in IDE mode,
14 * this is the path that will be assigned to it *)
15 val path: Relative_path.t
17 (** Runs the declaration, naming, and typecheck phases on a single file. *)
18 val check_file_input :
19 TypecheckerOptions.t ->
20 (* What are the definitions in each file. Most likely coming from
21 * ServerEnv.env.files_info *)
22 FileInfo.t Relative_path.Map.t ->
23 (* File path or content buffer. When given file path, the mapping in file_info
24 * is used to find the declarations and run only the typechecking phase.
25 * When given content buffer it will be parsed, named, and declared before
26 * that. The declarations will be removed from shared memory afterwards. *)
27 ServerCommandTypes.file_input ->
28 Relative_path.t * Tast.program
30 val check_fileinfo :
31 TypecheckerOptions.t ->
32 Relative_path.t ->
33 FileInfo.t ->
34 Tast.program
36 (** Runs the declaration, naming, and typecheck phases on an already-parsed
37 AST. *)
38 val check_ast :
39 TypecheckerOptions.t ->
40 Ast.program ->
41 Tast.program
43 (* Parses, names, declares and typechecks the content buffer, then run f
44 * while the declared definitions are still available in shared memory.
45 * The declarations will be removed from shared memory afterwards. *)
46 val declare_and_check : string ->
47 f:(Relative_path.t -> FileInfo.t -> Tast.program -> 'a) -> TypecheckerOptions.t -> 'a
49 val get_errors: Relative_path.t -> string -> TypecheckerOptions.t -> Errors.t
51 (* Run the typing phase on a list of files and definitions they contain. *)
52 val recheck :
53 TypecheckerOptions.t ->
54 (Relative_path.t * FileInfo.t) list ->
55 (Relative_path.t * Tast.program) list