diff options
-rw-r--r-- | crates/completion/src/item.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index 0134ff219..5d91d3a5c 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs | |||
@@ -398,7 +398,9 @@ impl Builder { | |||
398 | pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder { | 398 | pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder { |
399 | self.detail = detail.map(Into::into); | 399 | self.detail = detail.map(Into::into); |
400 | if let Some(detail) = &self.detail { | 400 | if let Some(detail) = &self.detail { |
401 | assert_never!(detail.contains('\n'), "multiline detail: {}", detail); | 401 | if assert_never!(detail.contains('\n'), "multiline detail: {}", detail) { |
402 | self.detail = Some(detail.splitn(2, '\n').next().unwrap().to_string()); | ||
403 | } | ||
402 | } | 404 | } |
403 | self | 405 | self |
404 | } | 406 | } |