From ce70fce3b220b0f58d3e9b285fe90d4b64efa451 Mon Sep 17 00:00:00 2001 From: rezzaghi Date: Fri, 23 Sep 2022 11:01:00 -0300 Subject: [PATCH] Add path to error message when trying to read directory --- crates/compiler/load_internal/src/file.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/compiler/load_internal/src/file.rs b/crates/compiler/load_internal/src/file.rs index 472a9146cb..2b1bef59fd 100644 --- a/crates/compiler/load_internal/src/file.rs +++ b/crates/compiler/load_internal/src/file.rs @@ -5642,10 +5642,16 @@ fn to_file_problem_report(filename: &Path, error: io::ErrorKind) -> String { _ => { let error = std::io::Error::from(error); let formatted = format!("{}", error); - let doc = alloc.concat([ - alloc.reflow(r"I tried to read this file, but ran into a "), - alloc.text(formatted), - alloc.reflow(r" problem."), + let doc = alloc.stack([ + alloc.reflow(r"I tried to read this file:"), + alloc + .parser_suggestion(filename.to_str().unwrap()) + .indent(4), + alloc.concat([ + alloc.reflow(r"But ran into a "), + alloc.text(formatted), + alloc.reflow(r" problem."), + ]) ]); Report {