aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/item.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-14 15:27:20 +0000
committerGitHub <[email protected]>2021-01-14 15:27:20 +0000
commit540edee3cd11d45a03abc072bb9b6f01b59bcb25 (patch)
tree7d86fca4364984808724ccc5694aef20a43d686c /crates/completion/src/item.rs
parentaeacaeed4e49dd71ba0de30a21d9f3d1cc153cec (diff)
parent8dc68ecdfcc764c7c0dcf5fcedcb51b092d99620 (diff)
Merge #7270
7270: Introduce more appropriate assertion mechanism r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/completion/src/item.rs')
-rw-r--r--crates/completion/src/item.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs
index 35af354b0..0134ff219 100644
--- a/crates/completion/src/item.rs
+++ b/crates/completion/src/item.rs
@@ -7,6 +7,7 @@ use ide_db::helpers::{
7 insert_use::{self, ImportScope, MergeBehavior}, 7 insert_use::{self, ImportScope, MergeBehavior},
8 mod_path_to_ast, SnippetCap, 8 mod_path_to_ast, SnippetCap,
9}; 9};
10use stdx::assert_never;
10use syntax::{algo, TextRange}; 11use syntax::{algo, TextRange};
11use text_edit::TextEdit; 12use text_edit::TextEdit;
12 13
@@ -396,6 +397,9 @@ impl Builder {
396 } 397 }
397 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 {
398 self.detail = detail.map(Into::into); 399 self.detail = detail.map(Into::into);
400 if let Some(detail) = &self.detail {
401 assert_never!(detail.contains('\n'), "multiline detail: {}", detail);
402 }
399 self 403 self
400 } 404 }
401 #[allow(unused)] 405 #[allow(unused)]