@@ -11,22 +11,11 @@ let file_lines filePath =
11
11
let setup_colors () =
12
12
Misc.Color. setup ! Clflags. color
13
13
14
- let print_filename ppf file =
15
- match file with
16
- (* modified *)
17
- | " _none_"
18
- | "" -> Format. fprintf ppf " (No file name)"
19
- | real_file -> Format. fprintf ppf " %s" (Location. show_filename real_file)
14
+ let print_filename = Location. print_filename
20
15
21
16
let print_loc ~normalizedRange ppf (loc : Location.t ) =
22
17
setup_colors () ;
23
- let (file, _, _) = Location. get_pos_info loc.loc_start in
24
- if file = " //toplevel//" then begin
25
- if Location. highlight_locations ppf [loc] then () else
26
- fprintf ppf " Characters %i-%i"
27
- loc.loc_start.pos_cnum loc.loc_end.pos_cnum
28
- end else
29
- let dim_loc ppf = function
18
+ let dim_loc ppf = function
30
19
| None -> ()
31
20
| Some ((start_line , start_line_start_char ), (end_line , end_line_end_char )) ->
32
21
if start_line = end_line then
@@ -36,8 +25,8 @@ let print_loc ~normalizedRange ppf (loc : Location.t) =
36
25
fprintf ppf " @{<dim>%i:%i-%i@}" start_line start_line_start_char end_line_end_char
37
26
else
38
27
fprintf ppf " @{<dim>%i:%i-%i:%i@}" start_line start_line_start_char end_line end_line_end_char
39
- in
40
- fprintf ppf " @{<filename>%a@}%a" print_filename file dim_loc normalizedRange
28
+ in
29
+ fprintf ppf " @{<filename>%a@}%a" print_filename loc.loc_start.pos_fname dim_loc normalizedRange
41
30
;;
42
31
43
32
let print ~message_kind intro ppf (loc : Location.t ) =
0 commit comments