@@ -32,8 +32,7 @@ use crate::{
35− borrow::Cow, cmp::Ordering, collections::BTreeMap, fmt::Write, future::Future, path::PathBuf,
35+ cmp::Ordering, collections::BTreeMap, fmt::Write, future::Future, path::PathBuf, sync::Arc,
39/// Gets the language server that is attached to a document, and
38/// Gets the language server that is attached to a document, and
@@ -138,15 +137,11 @@ impl ui::menu::Item for PickerDiagnostic {
138 // remove background as it is distracting in the picker list
137 // remove background as it is distracting in the picker list
139 style.bg = None;
138 style.bg = None;
141− let code: Cow<'_, str> = self
140+ let code = match self.diag.code.as_ref() {
146− NumberOrString::Number(n) => n.to_string().into(),
141+ Some(NumberOrString::Number(n)) => format!(" ({n})"),
147− NumberOrString::String(s) => s.as_str().into(),
142+ Some(NumberOrString::String(s)) => format!(" ({s})"),
148− })
143+ None => String::new(),
149− .unwrap_or_default();
144+ };
151 let path = match format {
146 let path = match format {
152 DiagnosticsFormat::HideSourcePath => String::new(),
147 DiagnosticsFormat::HideSourcePath => String::new(),