@@ -11,6 +11,7 @@ use crate::{
13use helix_core::{
13use helix_core::{
14+ diagnostic::NumberOrString,
14 graphemes::{
15 graphemes::{
15 ensure_grapheme_boundary_next_byte, next_grapheme_boundary, prev_grapheme_boundary,
16 ensure_grapheme_boundary_next_byte, next_grapheme_boundary, prev_grapheme_boundary,
@@ -30,7 +31,7 @@ use helix_view::{
31use std::{mem::take, num::NonZeroUsize, path::PathBuf, rc::Rc, sync::Arc};
32use std::{mem::take, num::NonZeroUsize, path::PathBuf, rc::Rc, sync::Arc};
33−use tui::buffer::Buffer as Surface;
34+use tui::{buffer::Buffer as Surface, text::Span};
35use super::statusline;
36use super::statusline;
36use super::{document::LineDecoration, lsp::SignatureHelp};
37use super::{document::LineDecoration, lsp::SignatureHelp};
@@ -684,6 +685,14 @@ impl EditorView {
685 let text = Text::styled(&diagnostic.message, style);
686 let text = Text::styled(&diagnostic.message, style);
686 lines.extend(text.lines);
687 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})"),
692+ if let Some(code) = code {
693+ let span = Span::styled(code, style);
694+ lines.push(span.into());
689 let paragraph = Paragraph::new(lines)
698 let paragraph = Paragraph::new(lines)