Browse Source

[display] don't full-path null_pos in diagnostics

Simon Krajewski 6 years ago
parent
commit
41306fef5f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/context/display/diagnostics.ml

+ 2 - 2
src/context/display/diagnostics.ml

@@ -146,7 +146,7 @@ module Printer = struct
 	let print_diagnostics dctx com global =
 		let diag = Hashtbl.create 0 in
 		let add dk p sev args =
-			let file = Path.get_real_path p.pfile in
+			let file = if p = null_pos then p.pfile else Path.get_real_path p.pfile in
 			let diag = try
 				Hashtbl.find diag file
 			with Not_found ->
@@ -199,7 +199,7 @@ module Printer = struct
 				]) :: acc
 			) diag [] in
 			(JObject [
-				"file",JString file;
+				"file",if file = "?" then JNull else JString file;
 				"diagnostics",JArray jl
 			]) :: acc
 		) diag [] in