@@ -11,6 +11,7 @@ use crate::{
1111};
1212
1313use helix_core::{
14+ diagnostic::NumberOrString,
1415 graphemes::{
1516 ensure_grapheme_boundary_next_byte, next_grapheme_boundary, prev_grapheme_boundary,
1617 },
@@ -30,7 +31,7 @@ use helix_view::{
3031};
3132use std::{mem::take, num::NonZeroUsize, path::PathBuf, rc::Rc, sync::Arc};
3233
33−use tui::buffer::Buffer as Surface;
34+use tui::{buffer::Buffer as Surface, text::Span};
3435
3536use super::statusline;
3637use super::{document::LineDecoration, lsp::SignatureHelp};
@@ -684,6 +685,14 @@ impl EditorView {
684685 });
685686 let text = Text::styled(&diagnostic.message, style);
686687 lines.extend(text.lines);
688+ let code = diagnostic.code.as_ref().map(|x| match x {
689+ NumberOrString::Number(n) => format!("({n})"),
690+ NumberOrString::String(s) => format!("({s})"),
691+ });
692+ if let Some(code) = code {
693+ let span = Span::styled(code, style);
694+ lines.push(span.into());
695+ }
687696 }
688697
689698 let paragraph = Paragraph::new(lines)