Browse Source

skip hxb generation on display too

Rudy Ges 1 year ago
parent
commit
a855226cbe
2 changed files with 6 additions and 4 deletions
  1. 4 4
      src/compiler/compiler.ml
  2. 2 0
      src/context/common.ml

+ 4 - 4
src/compiler/compiler.ml

@@ -377,19 +377,19 @@ let compile ctx actx callbacks =
 		let (tctx,display_file_dot_path) = do_type ctx mctx actx display_file_dot_path in
 		DisplayProcessing.handle_display_after_typing ctx tctx display_file_dot_path;
 		finalize_typing ctx tctx;
-		let is_diagnostics = is_diagnostics com in
+		let is_compilation = is_compilation com in
 		com.callbacks#add_after_save (fun () ->
 			callbacks.after_save ctx;
-			if not is_diagnostics then Generate.check_hxb_output com actx;
+			if is_compilation then Generate.check_hxb_output com actx;
 		);
-		if is_diagnostics then
+		if is_diagnostics com then
 			filter ctx tctx (fun () -> DisplayProcessing.handle_display_after_finalization ctx tctx display_file_dot_path)
 		else begin
 			DisplayProcessing.handle_display_after_finalization ctx tctx display_file_dot_path;
 			filter ctx tctx (fun () -> ());
 		end;
 		if ctx.has_error then raise Abort;
-		if not is_diagnostics then Generate.check_auxiliary_output com actx;
+		if is_compilation then Generate.check_auxiliary_output com actx;
 		enter_stage com CGenerationStart;
 		ServerMessage.compiler_stage com;
 		if not actx.no_output then Generate.generate ctx tctx ext actx;

+ 2 - 0
src/context/common.ml

@@ -886,6 +886,8 @@ let is_diagnostics com = match com.report_mode with
 	| RMLegacyDiagnostics _ | RMDiagnostics _ -> true
 	| _ -> false
 
+let is_compilation com = com.display.dms_kind = DMNone && not (is_diagnostics com)
+
 let disable_report_mode com =
 	let old = com.report_mode in
 	com.report_mode <- RMNone;