Skip to content

Commit

Permalink
Display error code only if not none
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin authored and archseer committed Jul 6, 2022
1 parent 0c10468 commit a43bcc8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ impl ui::menu::Item for PickerDiagnostic {
NumberOrString::Number(n) => n.to_string(),
NumberOrString::String(s) => s.to_string(),
})
.map(|code| format!(" ({})", code))
.unwrap_or_default();

let truncated_path = path::get_truncated_path(self.url.path())
Expand All @@ -135,9 +136,7 @@ impl ui::menu::Item for PickerDiagnostic {
Span::raw(truncated_path),
Span::raw(": "),
Span::styled(&self.diag.message, style),
Span::raw(" ("),
Span::styled(code, style.add_modifier(Modifier::BOLD)),
Span::raw(")"),
Span::styled(code, style),
])
}
}
Expand Down

0 comments on commit a43bcc8

Please sign in to comment.