Skip to content

Commit

Permalink
Only check dependencies when full typing (#11872)
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored Dec 11, 2024
1 parent f6e8fb3 commit c6e265e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/compiler/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ->
Expand Down

0 comments on commit c6e265e

Please sign in to comment.