Bladeren bron

[server] actually use the correct numbers

Simon Krajewski 3 jaren geleden
bovenliggende
commit
5efd75d618
2 gewijzigde bestanden met toevoegingen van 7 en 7 verwijderingen
  1. 4 4
      src/compiler/compiler.ml
  2. 3 3
      src/compiler/server.ml

+ 4 - 4
src/compiler/compiler.ml

@@ -750,7 +750,7 @@ let compile_ctx server_api comm ctx =
 			error ctx ("Error: " ^ msg) null_pos;
 			false
 
-let create_context compilation_step comm cs params = {
+let create_context comm cs compilation_step params = {
 	com = Common.create compilation_step cs version params;
 	messages = [];
 	has_next = false;
@@ -765,7 +765,7 @@ module HighLevel = struct
 		let compilations = DynArray.create () in
 		let curdir = Unix.getcwd () in
 		let add_context args =
-			let ctx = create args in
+			let ctx = create (server_api.on_context_create()) args in
 			(* --cwd triggers immediately, so let's reset *)
 			Unix.chdir curdir;
 			DynArray.add compilations ctx;
@@ -811,11 +811,11 @@ module HighLevel = struct
 		DynArray.to_list compilations
 
 	let entry server_api comm args =
-		let create = create_context (server_api.on_context_create()) comm server_api.cache in
+		let create = create_context comm server_api.cache in
 		let ctxs = try
 			process_params server_api create args
 		with Arg.Bad msg ->
-			let ctx = create args in
+			let ctx = create 0 args in
 			error ctx ("Error: " ^ msg) null_pos;
 			[ctx]
 		in

+ 3 - 3
src/compiler/server.ml

@@ -315,7 +315,7 @@ let check_module sctx ctx m p =
 			end
 		) paths
 	in
-	let start_mark = sctx.compilation_step in
+	let start_mark = ctx.com.compilation_step in
 	let rec check m =
 		let check_module_path () =
 			let directories = get_changed_directories sctx ctx in
@@ -415,13 +415,13 @@ let check_module sctx ctx m p =
 let add_modules sctx ctx m p =
 	let com = ctx.Typecore.com in
 	let rec add_modules tabs m0 m =
-		if m.m_extra.m_added < sctx.compilation_step then begin
+		if m.m_extra.m_added < ctx.com.compilation_step then begin
 			(match m0.m_extra.m_kind, m.m_extra.m_kind with
 			| MCode, MMacro | MMacro, MCode ->
 				(* this was just a dependency to check : do not add to the context *)
 				PMap.iter (Hashtbl.replace com.resources) m.m_extra.m_binded_res;
 			| _ ->
-				m.m_extra.m_added <- sctx.compilation_step;
+				m.m_extra.m_added <- ctx.com.compilation_step;
 				ServerMessage.reusing com tabs m;
 				List.iter (fun t ->
 					match t with