@@ -140,21 +140,12 @@ class file_keys = object(self)
140140
141141end
142142
143- type shared_display_information = {
144- mutable diagnostics_messages : diagnostic list ;
145- }
146-
147143type display_information = {
148144 mutable unresolved_identifiers : (string * pos * (string * CompletionItem .t * int ) list ) list ;
149145 mutable display_module_has_macro_defines : bool ;
150146 mutable module_diagnostics : DisplayTypes .module_diagnostics list ;
151147}
152148
153- (* This information is shared between normal and macro context. *)
154- type shared_context = {
155- shared_display_information : shared_display_information ;
156- }
157-
158149type json_api = {
159150 send_result : Json .t -> unit ;
160151 send_result_raise : 'a . Json .t -> 'a ;
288279
289280type part_scope = {
290281 warned_positions : (string * int , string * Globals .pos * warning_option list list ) Hashtbl .t ;
282+ mutable diagnostics_messages : diagnostic list ;
291283}
292284
293285type request_scope = {
@@ -346,7 +338,6 @@ type context = {
346338 (* typing state *)
347339 mutable std : tclass ;
348340 mutable global_metadata : (string list * metadata_entry * (bool * bool * bool )) list ;
349- shared : shared_context ;
350341 display_information : display_information ;
351342 file_keys : file_keys ;
352343 mutable file_contents : (Path.UniqueKey .t * string option ) list ;
@@ -749,6 +740,7 @@ let create io request_scope compilation_step sctx version args display_mode =
749740 request_scope;
750741 part_scope = {
751742 warned_positions = Hashtbl. create 0 ;
743+ diagnostics_messages = [] ;
752744 };
753745 compilation_step = compilation_step;
754746 sctx;
@@ -758,11 +750,6 @@ let create io request_scope compilation_step sctx version args display_mode =
758750 stage = CCreated ;
759751 version = version;
760752 args = args;
761- shared = {
762- shared_display_information = {
763- diagnostics_messages = [] ;
764- }
765- };
766753 display_information = {
767754 unresolved_identifiers = [] ;
768755 display_module_has_macro_defines = false ;
@@ -888,7 +875,6 @@ let clone com is_macro_context =
888875 timer_ctx = com.timer_ctx;
889876 version = com.version;
890877 args = com.args;
891- shared = com.shared;
892878 debug = com.debug;
893879 display = com.display;
894880 verbose = com.verbose;
@@ -1140,7 +1126,7 @@ let hash f =
11401126
11411127let add_diagnostics_message ?(depth = 0 ) ?(code = None ) com s p kind sev =
11421128 if sev = MessageSeverity. Error then com.has_error < - true ;
1143- let di = com.shared.shared_display_information in
1129+ let di = com.part_scope in
11441130 di.diagnostics_messages < - (make_diagnostic ~depth ~code s p kind sev) :: di.diagnostics_messages
11451131
11461132let display_error_ext com err =
0 commit comments