summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvinhagemeister50@gmail.com>2023-03-27 01:10:47 +0200
committerGitHub <noreply@github.com>2023-03-27 01:10:47 +0200
commit355275ec0ffb2f7e93ebb8494e24041d29ec51f0 (patch)
treed8a57ee31d122e049ef002e9c2bb19701b25b8ef
parenta29d88b43bdc3bf08a30fdb64d35beef8839f246 (diff)
fix(cli): add colors to "Module not found" error frame (#18437)
-rw-r--r--cli/graph_util.rs7
-rw-r--r--cli/tools/vendor/build.rs2
2 files changed, 7 insertions, 2 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs
index 6c38dccad..5dc7d17d6 100644
--- a/cli/graph_util.rs
+++ b/cli/graph_util.rs
@@ -96,7 +96,12 @@ pub fn graph_valid(
if let Some(range) = error.maybe_range() {
if !is_root && !range.specifier.as_str().contains("/$deno$eval") {
- message.push_str(&format!("\n at {range}"));
+ message.push_str(&format!(
+ "\n at {}:{}:{}",
+ colors::cyan(range.specifier.as_str()),
+ colors::yellow(&(range.start.line + 1).to_string()),
+ colors::yellow(&(range.start.character + 1).to_string())
+ ));
}
}
diff --git a/cli/tools/vendor/build.rs b/cli/tools/vendor/build.rs
index 3bee843fd..f9df8f078 100644
--- a/cli/tools/vendor/build.rs
+++ b/cli/tools/vendor/build.rs
@@ -1117,7 +1117,7 @@ mod test {
.unwrap();
assert_eq!(
- err.to_string(),
+ test_util::strip_ansi_codes(&err.to_string()),
concat!(
"500 Internal Server Error\n",
" at https://localhost/mod.ts:1:14"