diff --git a/src/services/autocomplete/autocompleteService_js.ml b/src/services/autocomplete/autocompleteService_js.ml index 7b2567ed22d..7148030eae5 100644 --- a/src/services/autocomplete/autocompleteService_js.ml +++ b/src/services/autocomplete/autocompleteService_js.ml @@ -745,9 +745,18 @@ let autocomplete_get_results ~options ~reader ~cx ~file_sig ~ast ~typed_ast trig in_optional_chain ac_loc ~tparams ) - | Some (tparams, ac_loc, Acjsx (ac_name, used_attr_names, cls)) -> + | Some (tparams, ac_loc, Acjsx { attribute_name; used_attr_names; component_t }) -> ( "Acjsx", - autocomplete_jsx ~reader cx file_sig typed_ast cls ac_name ~used_attr_names ac_loc ~tparams ) + autocomplete_jsx + ~reader + cx + file_sig + typed_ast + component_t + attribute_name + ~used_attr_names + ac_loc + ~tparams ) | Some (tparams, ac_loc, Actype { token }) -> ( "Actype", autocomplete_unqualified_type diff --git a/src/services/autocomplete/autocomplete_js.ml b/src/services/autocomplete/autocomplete_js.ml index 97b62e8f2c0..ba95baeed32 100644 --- a/src/services/autocomplete/autocomplete_js.ml +++ b/src/services/autocomplete/autocomplete_js.ml @@ -34,7 +34,11 @@ type autocomplete_type = in_optional_chain: bool; } (* JSX attributes *) - | Acjsx of string * SSet.t * Type.t + | Acjsx of { + attribute_name: string; + used_attr_names: SSet.t; + component_t: Type.t; + } (* JSX text child *) | Acjsxtext @@ -176,7 +180,7 @@ class process_request_searcher (from_trigger_character : bool) (cursor : Loc.t) in Base.Option.iter ~f:(fun (attribute_name, loc, component_t) -> - this#find loc (Acjsx (attribute_name, used_attr_names, component_t))) + this#find loc (Acjsx { attribute_name; used_attr_names; component_t })) found; super#jsx_opening_element elt