From 8342f7af9a18d24250f870c8eb1701fe9d2e876c Mon Sep 17 00:00:00 2001 From: Alex Snezhko Date: Sat, 2 Mar 2024 22:01:00 +0000 Subject: [PATCH] Address review feedback --- compiler/src/typed/env.re | 4 ++-- compiler/src/typed/module_resolution.re | 8 ++++---- compiler/test/suites/includes.re | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/src/typed/env.re b/compiler/src/typed/env.re index 3e0b2a306c..9d893f80bb 100644 --- a/compiler/src/typed/env.re +++ b/compiler/src/typed/env.re @@ -2632,9 +2632,9 @@ let report_error = ppf => alt, ) | Unbound_module(_, modname) => fprintf(ppf, "Unbound module %s", modname) - | No_module_file(m, None) => fprintf(ppf, "Missing file for module %s", m) + | No_module_file(m, None) => fprintf(ppf, "Missing file for module \"%s\"", m) | No_module_file(m, Some(msg)) => - fprintf(ppf, "Missing file for module %s: %s", m, msg) + fprintf(ppf, "Missing file for module \"%s\": %s", m, msg) | Value_not_found_in_module(_, name, path) => fprintf(ppf, "Unbound value %s in module %s", name, path) | Module_not_found_in_module(_, name, path, None) => diff --git a/compiler/src/typed/module_resolution.re b/compiler/src/typed/module_resolution.re index 6b90595cf3..5beb4b5371 100644 --- a/compiler/src/typed/module_resolution.re +++ b/compiler/src/typed/module_resolution.re @@ -240,7 +240,7 @@ let try_locate_module = No_module_file( loc, name, - Some("did you forget to remove the .gr extension?"), + Some("did you mean \"" ++ no_extension ++ "\"?"), ), ); }; @@ -252,7 +252,7 @@ let try_locate_module = No_module_file( loc, name, - Some("did you forget to add the .gr extension?"), + Some("did you mean \"" ++ name ++ ".gr\"?"), ), ) }; @@ -569,9 +569,9 @@ let report_error = ppf => ); } | No_module_file(_, m, None) => - fprintf(ppf, "Missing file for module %s", m) + fprintf(ppf, "Missing file for module \"%s\"", m) | No_module_file(_, m, Some(msg)) => - fprintf(ppf, "Missing file for module %s: %s", m, msg); + fprintf(ppf, "Missing file for module \"%s\": %s", m, msg); let () = Location.register_error_of_exn( diff --git a/compiler/test/suites/includes.re b/compiler/test/suites/includes.re index 44b782a63f..f7ec1ff34b 100644 --- a/compiler/test/suites/includes.re +++ b/compiler/test/suites/includes.re @@ -153,7 +153,7 @@ describe("includes", ({test, testSkip}) => { assertCompileError( "include_missing_file", "from \"foo\" include Foo; 2", - "Missing file for module foo", + "Missing file for module \"foo.gr\"", ); /* Unbound module tests */ assertCompileError( @@ -185,12 +185,12 @@ describe("includes", ({test, testSkip}) => { assertCompileError( "include_extension1", "from \"list.gr\" include List", - "Missing file for module list.gr: did you forget to remove the .gr extension?", + "Missing file for module \"list.gr\": did you mean \"list\"?", ); assertCompileError( "include_extension2", "from \"brokenRelativeInclude\" include BrokenRelativeInclude", - "Missing file for module ./data: did you forget to add the .gr extension?", + "Missing file for module \"./data\": did you mean \"./data.gr\"?", ); assertRun( "reprovide_values",