@@ -31,18 +31,33 @@ module Cmi = struct
3131 fprintf ppf " %a@ is not a compiled interface"
3232 Location. print_filename filename
3333 | Wrong_version_interface (filename , compiler_magic ) ->
34+ let program_name = Lib_config. program_name () in
3435 begin match to_version_opt compiler_magic with
3536 | None ->
3637 fprintf ppf
37- " %a@ seems to be compiled with a version of OCaml that is not@.\
38- supported by Merlin."
38+ " Compiler version mismatch: this project seems to be compiled with a \
39+ version of the OCaml compiler that is not supported by this version \
40+ of %s. OCaml language support will not work properly until this \
41+ problem is fixed. \n \
42+ Hint: It seems that the project is built with a newer OCaml compiler \
43+ version that the running %s version does not know about. Make sure \
44+ your editor runs a version of %s that supports this version of the \
45+ compiler. \n \
46+ This diagnostic is based on the compiled interface file: %a"
47+ program_name program_name program_name
3948 Location. print_filename filename
4049 | Some version ->
4150 fprintf ppf
42- " %a@ seems to be compiled with OCaml %s.@.\
43- But this instance of Merlin handles OCaml %s."
44- Location. print_filename filename version
51+ " Compiler version mismatch: this project seems to be compiled with \
52+ version %s of the OCaml compiler, but the running %s supports OCaml \
53+ version %s. OCaml language support will not work properly until this \
54+ problem is fixed. \n \
55+ Hint: Make sure your editor runs a version of %s that supports the \
56+ correct version of the compiler. \n \
57+ This diagnostic is based on the compiled interface file: %a"
58+ version program_name
4559 (Option. get @@ to_version_opt Config. cmi_magic_number)
60+ program_name Location. print_filename filename
4661 end
4762 | Corrupted_interface filename ->
4863 fprintf ppf " Corrupted compiled interface@ %a"
0 commit comments