aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-09 18:21:50 +0100
committerGitHub <[email protected]>2021-06-09 18:21:50 +0100
commit85056423e3d14fc59bca06d3b2e0c44041653945 (patch)
tree482b3232ebab974ca73616fef50bfc531f44b53f /crates/ide_completion/src/completions
parent5f592f4f58a6e1e1db0f920af34a2f569b65017c (diff)
parent1e51b137d947b209a083f43cd4b0903d7ba28ce3 (diff)
Merge #9193
9193: Implement dummy expansions for builtin attributes r=jonas-schievink a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/qualified_path.rs26
-rw-r--r--crates/ide_completion/src/completions/unqualified_path.rs12
2 files changed, 32 insertions, 6 deletions
diff --git a/crates/ide_completion/src/completions/qualified_path.rs b/crates/ide_completion/src/completions/qualified_path.rs
index 0b0a81410..58d4dd9ee 100644
--- a/crates/ide_completion/src/completions/qualified_path.rs
+++ b/crates/ide_completion/src/completions/qualified_path.rs
@@ -657,6 +657,32 @@ fn main() { let _ = crate::$0 }
657 } 657 }
658 658
659 #[test] 659 #[test]
660 fn does_not_complete_non_fn_macros() {
661 check(
662 r#"
663mod m {
664 #[rustc_builtin_macro]
665 pub macro Clone {}
666}
667
668fn f() {m::$0}
669"#,
670 expect![[r#""#]],
671 );
672 check(
673 r#"
674mod m {
675 #[rustc_builtin_macro]
676 pub macro bench {}
677}
678
679fn f() {m::$0}
680"#,
681 expect![[r#""#]],
682 );
683 }
684
685 #[test]
660 fn completes_in_assoc_item_list() { 686 fn completes_in_assoc_item_list() {
661 check( 687 check(
662 r#" 688 r#"
diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs
index 1f6c4069f..b1e6b2b77 100644
--- a/crates/ide_completion/src/completions/unqualified_path.rs
+++ b/crates/ide_completion/src/completions/unqualified_path.rs
@@ -481,14 +481,14 @@ impl S {
481 ); 481 );
482 check( 482 check(
483 r#" 483 r#"
484mod m { 484#[rustc_builtin_macro]
485 #[rustc_builtin_macro] 485pub macro bench {}
486 pub macro Clone {}
487}
488 486
489fn f() {m::$0} 487fn f() {$0}
490"#, 488"#,
491 expect![[r#""#]], 489 expect![[r#"
490 fn f() fn()
491 "#]],
492 ); 492 );
493 } 493 }
494 494