Apparently, utop is involved (I have a utop-company-backend in the company settings). The function UTop_complete.complete does return a bunch of module and constructor names on a string ending with a dot, or on an empty string :
UTop_complete.complete ~phrase_terminator:"" ~input:"x.f.";;
val _27 : int * (string * string) list =
(4,
[("Afl_instrument", ""); ("Alias_analysis", ""); ("Allocated_const", "");
("Annot", ""); ("Arch", ""); ("Arg_helper", ""); ("Asmgen", "");
("Asmlibrarian", ""); ("Asmlink", ""); ("Asmpackager", "");
("Assert_failure", ""); ("Ast_helper", ""); ("Ast_invariants", "");
("Ast_iterator", ""); ("Ast_mapper", ""); ("Asttypes", "");
("Attr_helper", ""); ("Augment_specialised_args", "");
("Backend_intf", ""); ("Backend_var", ""); ("Binutils", "");
("Branch_relaxation", ""); ("Branch_relaxation_intf", ""); ("Btype", "");
("Build_export_info", ""); ("Build_path_prefix_map", "");
("Builtin_attributes", ""); ("Bytegen", ""); ("Bytelibrarian", "");
("Bytelink", ""); ("Bytepackager", ""); ("Bytesections", "");
("CSE", ""); ("CSEgen", ""); ("CamlinternalFormat", "");
("CamlinternalFormatBasics", ""); ("CamlinternalLazy", "");
("CamlinternalMenhirLib", ""); ("CamlinternalMod", "");
("CamlinternalOO", ""); ("Ccomp", ""); ("Clambda", "");
("Clambda_primitives", ""); ("Clflags", ""); ("Closure", "");
("Closure_conversion", ""); ("Closure_conversion_aux", "");
("Closure_element", ""); ("Closure_id", ""); ("Closure_middle_end", "");
("Closure_offsets", ""); ("Closure_origin", ""); ("Cmi_format", "");
("Cmm", ""); ("Cmm_helpers", ""); ("Cmm_invariants", ""); ("Cmmgen", "");
("Cmmgen_state", ""); ("Cmo_format", ""); ("Cmt2annot", "");
("Cmt_format", ""); ("Cmx_format", ""); ("Cmxs_format", "");
("Coloring", ""); ("Comballoc", ""); ("Compenv", "");
("Compilation_unit", ""); ("Compile", ""); ("Compile_common", "");
("Compilenv", ""); ("Compmisc", ""); ("Compression", ""); ("Config", "");
("Config_boot", ""); ("Config_main", ""); ("Consistbl", "");
("Continuation_already_taken", ""); ("Convert_primitives", "");
("Ctype", ""); ("Data_types", ""); ("Dataflow", ""); ("Datarepr", "");
("Deadcode", ""); ("Debuginfo", ""); ("Depend", ""); ("Diffing", "");
("Diffing_with_keys", ""); ("Division_by_zero", ""); ("Dll", "");
("Docstrings", ""); ("Domainstate", ""); ("Effect_analysis", "");
("Emit", ""); ("Emitaux", ""); ("Emitcode", ""); ("Emitenv", "");
("End_of_f"... (* string length 11; truncated *), ""); ("Env", "");
("Envaux", ""); ...])
This makes me wonder why the completion list in the end is not longer. Maybe there is some filtering done, but that fails to remove the “internal” modules ?