Several XHP autocomplete fixes
[hiphop-php.git] / hphp / hack / src / server / autocompleteTypes.mli
blob99f7de7191a1f3be64d002fa8a251bd4de8580bb
1 (**
2 * Copyright (c) 2017, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the "hack" directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
9 *)
11 (* Details about functions to be added in json output *)
12 type func_param_result = {
13 param_name : string;
14 param_ty : string;
15 param_variadic : bool;
18 type func_details_result = {
19 params : func_param_result list;
20 return_ty : string;
21 min_arity : int;
24 type autocomplete_kind =
25 | Abstract_class_kind
26 | Class_kind
27 | Class_constant_kind
28 | Constructor_kind
29 | Enum_kind
30 | Function_kind
31 | Interface_kind
32 | Keyword_kind
33 | Method_kind
34 | Namespace_kind
35 | Property_kind
36 | Trait_kind
37 | Variable_kind
39 (* Results ready to be displayed to the user *)
40 type complete_autocomplete_result = {
41 res_pos : Pos.absolute;
42 res_ty : string;
43 res_name : string;
44 res_kind : autocomplete_kind;
45 func_details : func_details_result option;
48 (* Results that still need a typing environment to convert ty information
49 into strings *)
50 type partial_autocomplete_result = {
51 ty : Typing_defs.phase_ty;
52 name : string;
53 kind_: autocomplete_kind;
56 type autocomplete_result =
57 | Partial of partial_autocomplete_result
58 | Complete of complete_autocomplete_result
60 (* The type returned to the client *)
61 type ide_result = {
62 completions : complete_autocomplete_result list;
63 char_at_pos : char;
64 is_complete : bool;
67 type result = complete_autocomplete_result list
69 type legacy_autocomplete_context = {
70 is_xhp_classname : bool;
71 is_instance_member : bool;