Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): print diagnostic for scanner panics #4861

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crates/biome_cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ use biome_configuration::{
};
use biome_configuration::{BiomeDiagnostic, Configuration};
use biome_console::{markup, Console, ConsoleExt};
use biome_diagnostics::PrintDiagnostic;
use biome_diagnostics::{Diagnostic, PrintDiagnostic, Severity};
use biome_fs::{BiomePath, FileSystem};
use biome_grit_patterns::GritTargetLanguage;
use biome_service::configuration::{
@@ -809,6 +809,11 @@ pub(crate) trait CommandRunner: Sized {
project_key,
path: Some(project_path),
})?;
for diagnostic in result.diagnostics {
if diagnostic.severity() == Severity::Fatal {
console.log(markup! {{PrintDiagnostic::simple(&diagnostic)}});
}
}
if cli_options.verbose && matches!(execution.report_mode(), ReportMode::Terminal { .. })
{
console.log(markup! {
2 changes: 1 addition & 1 deletion crates/biome_service/src/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -184,7 +184,7 @@ impl From<WorkspaceError> for biome_diagnostics::serde::Diagnostic {
pub struct NotFound;

#[derive(Debug, Diagnostic, Deserialize, Serialize)]
#[diagnostic(category = "internalError/panic", tags(INTERNAL))]
#[diagnostic(category = "internalError/panic", severity = Fatal, tags(INTERNAL))]
pub struct Panic {
#[message]
#[description]