aboutsummaryrefslogtreecommitdiff
path: root/crates/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/completion')
-rw-r--r--crates/completion/src/completions/qualified_path.rs3
-rw-r--r--crates/completion/src/completions/unqualified_path.rs6
-rw-r--r--crates/completion/src/item.rs4
3 files changed, 7 insertions, 6 deletions
diff --git a/crates/completion/src/completions/qualified_path.rs b/crates/completion/src/completions/qualified_path.rs
index fa9e6e810..33df26761 100644
--- a/crates/completion/src/completions/qualified_path.rs
+++ b/crates/completion/src/completions/qualified_path.rs
@@ -590,8 +590,7 @@ fn main() { let _ = crate::$0 }
590 "#, 590 "#,
591 expect![[r##" 591 expect![[r##"
592 fn main() fn main() 592 fn main() fn main()
593 ma foo!(…) #[macro_export] 593 ma foo!(…) #[macro_export] macro_rules! foo
594 macro_rules! foo
595 "##]], 594 "##]],
596 ); 595 );
597 } 596 }
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs
index 7ba99447d..53e1391f3 100644
--- a/crates/completion/src/completions/unqualified_path.rs
+++ b/crates/completion/src/completions/unqualified_path.rs
@@ -540,8 +540,7 @@ mod macros {
540"#, 540"#,
541 expect![[r##" 541 expect![[r##"
542 fn f() fn f() 542 fn f() fn f()
543 ma concat!(…) #[macro_export] 543 ma concat!(…) #[macro_export] macro_rules! concat
544 macro_rules! concat
545 md std 544 md std
546 "##]], 545 "##]],
547 ); 546 );
@@ -597,8 +596,7 @@ fn main() { let v = $0 }
597"#, 596"#,
598 expect![[r##" 597 expect![[r##"
599 md m1 598 md m1
600 ma baz!(…) #[macro_export] 599 ma baz!(…) #[macro_export] macro_rules! baz
601 macro_rules! baz
602 fn main() fn main() 600 fn main() fn main()
603 md m2 601 md m2
604 ma bar!(…) macro_rules! bar 602 ma bar!(…) macro_rules! bar
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)]