|
@@ -310,6 +310,11 @@ let check_module sctx com m_path m_extra p =
|
|
|
(com.cs#get_context sign)#find_module_extra mpath
|
|
|
in
|
|
|
let check_dependencies () =
|
|
|
+ let full_restore =
|
|
|
+ com.is_macro_context
|
|
|
+ || com.display.dms_full_typing
|
|
|
+ || DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key m_extra.m_file)
|
|
|
+ in
|
|
|
PMap.iter (fun _ mdep ->
|
|
|
let sign = mdep.md_sign in
|
|
|
let mpath = mdep.md_path in
|
|
@@ -321,7 +326,7 @@ let check_module sctx com m_path m_extra p =
|
|
|
match check mpath m2_extra with
|
|
|
| None -> ()
|
|
|
| Some reason -> raise (Dirty (DependencyDirty(mpath,reason)))
|
|
|
- ) m_extra.m_deps;
|
|
|
+ ) (if full_restore then m_extra.m_deps else Option.default m_extra.m_deps m_extra.m_sig_deps)
|
|
|
in
|
|
|
let check () =
|
|
|
try
|
|
@@ -418,19 +423,20 @@ class hxb_reader_api_server
|
|
|
m
|
|
|
| BinaryModule mc ->
|
|
|
let reader = new HxbReader.hxb_reader path com.hxb_reader_stats (Some cc#get_string_pool_arr) (Common.defined com Define.HxbTimes) in
|
|
|
+ let is_display_file = DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key mc.mc_extra.m_file) in
|
|
|
+ let full_restore = com.is_macro_context || com.display.dms_full_typing || is_display_file in
|
|
|
let f_next chunks until =
|
|
|
let t_hxb = Timer.timer ["server";"module cache";"hxb read"] in
|
|
|
let r = reader#read_chunks_until (self :> HxbReaderApi.hxb_reader_api) chunks until in
|
|
|
t_hxb();
|
|
|
r
|
|
|
in
|
|
|
- let m,chunks = f_next mc.mc_chunks EOF in
|
|
|
+ let m,chunks = f_next mc.mc_chunks EOT in
|
|
|
|
|
|
(* We try to avoid reading expressions as much as possible, so we only do this for
|
|
|
our current display file if we're in display mode. *)
|
|
|
- let is_display_file = DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key m.m_extra.m_file) in
|
|
|
- if is_display_file || com.display.dms_full_typing then ignore(f_next chunks EOM)
|
|
|
- else delay (fun () -> ignore(f_next chunks EOM));
|
|
|
+ if full_restore then ignore(f_next chunks EOM)
|
|
|
+ else delay (fun () -> ignore(f_next chunks EOF));
|
|
|
m
|
|
|
| BadModule reason ->
|
|
|
die (Printf.sprintf "Unexpected BadModule %s" (s_type_path path)) __LOC__
|
|
@@ -490,6 +496,11 @@ let rec add_modules sctx com delay (m : module_def) (from_binary : bool) (p : po
|
|
|
if not from_binary || m != m then
|
|
|
com.module_lut#add m.m_path m;
|
|
|
handle_cache_bound_objects com m.m_extra.m_cache_bound_objects;
|
|
|
+ let full_restore =
|
|
|
+ com.is_macro_context
|
|
|
+ || com.display.dms_full_typing
|
|
|
+ || DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key m.m_extra.m_file)
|
|
|
+ in
|
|
|
PMap.iter (fun _ mdep ->
|
|
|
let mpath = mdep.md_path in
|
|
|
if mdep.md_sign = own_sign then begin
|
|
@@ -508,7 +519,7 @@ let rec add_modules sctx com delay (m : module_def) (from_binary : bool) (p : po
|
|
|
in
|
|
|
add_modules (tabs ^ " ") m0 m2
|
|
|
end
|
|
|
- ) m.m_extra.m_deps
|
|
|
+ ) (if full_restore then m.m_extra.m_deps else Option.default m.m_extra.m_deps m.m_extra.m_sig_deps)
|
|
|
)
|
|
|
end
|
|
|
in
|
|
@@ -568,6 +579,8 @@ and type_module sctx com delay mpath p =
|
|
|
begin match check_module sctx mpath mc.mc_extra p with
|
|
|
| None ->
|
|
|
let reader = new HxbReader.hxb_reader mpath com.hxb_reader_stats (Some cc#get_string_pool_arr) (Common.defined com Define.HxbTimes) in
|
|
|
+ let is_display_file = DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key mc.mc_extra.m_file) in
|
|
|
+ let full_restore = com.is_macro_context || com.display.dms_full_typing || is_display_file in
|
|
|
let api = match com.hxb_reader_api with
|
|
|
| Some api ->
|
|
|
api
|
|
@@ -582,12 +595,11 @@ and type_module sctx com delay mpath p =
|
|
|
t_hxb();
|
|
|
r
|
|
|
in
|
|
|
- let m,chunks = f_next mc.mc_chunks EOF in
|
|
|
+ let m,chunks = f_next mc.mc_chunks EOT in
|
|
|
(* We try to avoid reading expressions as much as possible, so we only do this for
|
|
|
our current display file if we're in display mode. *)
|
|
|
- let is_display_file = DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key m.m_extra.m_file) in
|
|
|
- if is_display_file || com.display.dms_full_typing then ignore(f_next chunks EOM)
|
|
|
- else delay (fun () -> ignore(f_next chunks EOM));
|
|
|
+ if full_restore then ignore(f_next chunks EOM)
|
|
|
+ else delay (fun () -> ignore(f_next chunks EOF));
|
|
|
add_modules true m;
|
|
|
| Some reason ->
|
|
|
skip mpath reason
|