mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 20:28:58 +00:00
fix(diagnostics): improve "file is too long to fit on the screen" (#5120)
closes #4322 Setting the threshold to 1200 because graphical output may contain ansi escape codes and other decorations.
This commit is contained in:
parent
76c66b4326
commit
ff7fa987db
1 changed files with 3 additions and 2 deletions
|
|
@ -150,8 +150,9 @@ impl DiagnosticService {
|
|||
}
|
||||
|
||||
if let Some(mut err_str) = self.reporter.render_error(diagnostic) {
|
||||
// Skip large output and print only once
|
||||
if err_str.lines().any(|line| line.len() >= 400) {
|
||||
// Skip large output and print only once.
|
||||
// Setting to 1200 because graphical output may contain ansi escape codes and other decorations.
|
||||
if err_str.lines().any(|line| line.len() >= 1200) {
|
||||
let minified_diagnostic = Error::new(
|
||||
OxcDiagnostic::warn("File is too long to fit on the screen")
|
||||
.with_help(format!("{path:?} seems like a minified file")),
|
||||
|
|
|
|||
Loading…
Reference in a new issue