aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/qualified_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/completions/qualified_path.rs')
-rw-r--r--crates/ide_completion/src/completions/qualified_path.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/crates/ide_completion/src/completions/qualified_path.rs b/crates/ide_completion/src/completions/qualified_path.rs
index a90325e06..c16bb215f 100644
--- a/crates/ide_completion/src/completions/qualified_path.rs
+++ b/crates/ide_completion/src/completions/qualified_path.rs
@@ -20,7 +20,6 @@ pub(crate) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionCon
20 None => return, 20 None => return,
21 }; 21 };
22 let context_module = ctx.scope.module(); 22 let context_module = ctx.scope.module();
23
24 if ctx.expects_item() || ctx.expects_assoc_item() { 23 if ctx.expects_item() || ctx.expects_assoc_item() {
25 if let PathResolution::Def(hir::ModuleDef::Module(module)) = resolution { 24 if let PathResolution::Def(hir::ModuleDef::Module(module)) = resolution {
26 let module_scope = module.scope(ctx.db, context_module); 25 let module_scope = module.scope(ctx.db, context_module);
@@ -606,7 +605,7 @@ fn main() { T::$0; }
606macro_rules! foo { () => {} } 605macro_rules! foo { () => {} }
607 606
608fn main() { let _ = crate::$0 } 607fn main() { let _ = crate::$0 }
609 "#, 608"#,
610 expect![[r##" 609 expect![[r##"
611 fn main() fn() 610 fn main() fn()
612 ma foo!(…) #[macro_export] macro_rules! foo 611 ma foo!(…) #[macro_export] macro_rules! foo
@@ -615,6 +614,25 @@ fn main() { let _ = crate::$0 }
615 } 614 }
616 615
617 #[test] 616 #[test]
617 fn completes_qualified_macros_in_impl() {
618 check(
619 r#"
620#[macro_export]
621macro_rules! foo { () => {} }
622
623struct MyStruct {}
624
625impl MyStruct {
626 crate::$0
627}
628"#,
629 expect![[r##"
630 ma foo! #[macro_export] macro_rules! foo
631 "##]],
632 );
633 }
634
635 #[test]
618 fn test_super_super_completion() { 636 fn test_super_super_completion() {
619 check( 637 check(
620 r#" 638 r#"