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