From 87b0ca1807c772af6e7d6c3ac7c739b134c6f35c Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Wed, 30 Jul 2014 13:49:59 +0100 Subject: [PATCH] handle module aliases for completion --- src/lib/uTop_complete.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib/uTop_complete.ml b/src/lib/uTop_complete.ml index e8d192e..772439f 100644 --- a/src/lib/uTop_complete.ml +++ b/src/lib/uTop_complete.ml @@ -462,6 +462,13 @@ let rec names_of_module_type = function #endif | None -> String_set.empty end +#if ocaml_version >= (4, 02, 0) + | Mty_alias path -> begin + match lookup_env Env.find_module path !Toploop.toplevel_env with + | None -> String_set.empty + | Some { md_type = module_type } -> names_of_module_type module_type + end +#endif | _ -> String_set.empty @@ -494,6 +501,13 @@ let rec fields_of_module_type = function #endif | None -> String_set.empty end +#if ocaml_version >= (4, 02, 0) + | Mty_alias path -> begin + match lookup_env Env.find_module path !Toploop.toplevel_env with + | None -> String_set.empty + | Some { md_type = module_type } -> fields_of_module_type module_type + end +#endif | _ -> String_set.empty