From c6e265ee2bb2d6200355a353d242e0bf74f5d3e2 Mon Sep 17 00:00:00 2001 From: Rudy Ges Date: Wed, 11 Dec 2024 14:31:08 +0100 Subject: [PATCH] Only check dependencies when full typing (#11872) --- src/compiler/server.ml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/compiler/server.ml b/src/compiler/server.ml index 22a5d8fb91b..08b27daed7b 100644 --- a/src/compiler/server.ml +++ b/src/compiler/server.ml @@ -310,11 +310,6 @@ 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 @@ -326,13 +321,17 @@ let check_module sctx com m_path m_extra p = match check mpath m2_extra with | None -> () | Some reason -> raise (Dirty (DependencyDirty(mpath,reason))) - ) (if full_restore then m_extra.m_deps else Option.default m_extra.m_deps m_extra.m_sig_deps) + ) m_extra.m_deps in let check () = try check_module_path(); if not (has_policy NoFileSystemCheck) || Path.file_extension (Path.UniqueKey.lazy_path m_extra.m_file) <> "hx" then check_file(); - check_dependencies(); + if ( + com.is_macro_context + || com.display.dms_full_typing + || DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key m_extra.m_file) + ) then check_dependencies(); None with | Dirty reason ->