@@ -2,6 +2,7 @@ use arc_swap::{access::Map, ArcSwap};
22use futures_util::Stream;
33use helix_core::{
44 config::{default_syntax_loader, user_syntax_loader},
5+ diagnostic::NumberOrString,
56 pos_at_coords, syntax, Selection,
67};
78use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
@@ -556,12 +557,24 @@ impl Application {
556557 }
557558 };
558559
560+ let code = match diagnostic.code.clone() {
561+ Some(x) => match x {
562+ lsp::NumberOrString::Number(x) => {
563+ Some(NumberOrString::Number(x))
564+ }
565+ lsp::NumberOrString::String(x) => {
566+ Some(NumberOrString::String(x))
567+ }
568+ },
569+ None => None,
570+ };
571+
559572 Some(Diagnostic {
560573 range: Range { start, end },
561574 line: diagnostic.range.start.line as usize,
562575 message: diagnostic.message.clone(),
563576 severity,
564− // code
577+ code,
565578 // source
566579 })
567580 })