diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-09-22 18:01:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 19:01:30 +0200 |
commit | a43984c9cfcea852ca18e1c575f9acdb8f023a5a (patch) | |
tree | 1d28894341a411583bb8e74becca81382ecd754b /cli/lint.rs | |
parent | a33315aaa70884c10968669c31adf3c6bb142e72 (diff) |
refactor(cli/fmt_errors): Color stack traces in Rust (#7628)
Diffstat (limited to 'cli/lint.rs')
-rw-r--r-- | cli/lint.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cli/lint.rs b/cli/lint.rs index 3b337fe7f..882ec4414 100644 --- a/cli/lint.rs +++ b/cli/lint.rs @@ -12,8 +12,7 @@ use crate::fmt::collect_files; use crate::fmt::run_parallelized; use crate::fmt_errors; use crate::media_type::MediaType; -use deno_core::error::generic_error; -use deno_core::error::AnyError; +use deno_core::error::{generic_error, AnyError, JsStackFrame}; use deno_core::serde_json; use deno_lint::diagnostic::LintDiagnostic; use deno_lint::linter::Linter; @@ -223,11 +222,11 @@ impl LintReporter for PrettyLintReporter { &pretty_message, &source_lines, d.range.clone(), - &fmt_errors::format_location( - &d.filename, - d.range.start.line as i64, - d.range.start.col as i64, - ), + &fmt_errors::format_location(&JsStackFrame::from_location( + Some(d.filename.clone()), + Some(d.range.start.line as i64), + Some(d.range.start.col as i64), + )), ); eprintln!("{}\n", message); |