Skip to content

Commit

Permalink
[hxb] display requests: consider all hxb modules good unless current …
Browse files Browse the repository at this point in the history
…display file

(#thisisfine)
  • Loading branch information
kLabz committed May 9, 2024
1 parent 931c8c9 commit 4437397
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/compiler/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,14 @@ class hxb_reader_api_server
GoodModule (com.module_lut#find m_path)
with Not_found -> try
let mc = cc#get_hxb_module m_path in
begin match mc.mc_extra.m_cache_state with
| MSBad reason -> BadModule reason
| _ -> BinaryModule mc
end
if not com.is_macro_context && not com.display.dms_full_typing && not (DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key mc.mc_extra.m_file)) then begin
mc.mc_extra.m_cache_state <- MSGood;
BinaryModule mc
end else
begin match mc.mc_extra.m_cache_state with
| MSBad reason -> BadModule reason
| _ -> BinaryModule mc
end
with Not_found ->
NoModule

Expand Down Expand Up @@ -550,15 +554,20 @@ and type_module sctx com delay mpath p =
try
let m = cc#find_module m_path in
begin match m.m_extra.m_cache_state with
| MSBad reason -> BadModule reason
| MSBad reason ->
BadModule reason
| _ -> GoodModule m
end;
with Not_found -> try
let mc = cc#get_hxb_module m_path in
begin match mc.mc_extra.m_cache_state with
| MSBad reason -> BadModule reason
| _ -> BinaryModule mc
end
if not com.is_macro_context && not com.display.dms_full_typing && not (DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key mc.mc_extra.m_file)) then begin
mc.mc_extra.m_cache_state <- MSGood;
BinaryModule mc
end else
begin match mc.mc_extra.m_cache_state with
| MSBad reason -> BadModule reason
| _ -> BinaryModule mc
end
with Not_found ->
NoModule
in
Expand Down

0 comments on commit 4437397

Please sign in to comment.