From 739edfd5cf6d1f5ac1ec6dbc28fc7943b3936e24 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 15 Apr 2021 23:31:42 +0300 Subject: Exclude inherent traits from flyimports --- crates/ide_completion/src/completions/flyimport.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates/ide_completion') diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs index 5e61ecb4d..8e211ae1e 100644 --- a/crates/ide_completion/src/completions/flyimport.rs +++ b/crates/ide_completion/src/completions/flyimport.rs @@ -1127,4 +1127,27 @@ impl Bar for Foo { expect![[r#""#]], ); } + + #[test] + fn no_inherent_candidates_proposed() { + check( + r#" +mod baz { + pub trait DefDatabase { + fn method1(&self); + } + pub trait HirDatabase: DefDatabase { + fn method2(&self); + } +} + +mod bar { + fn test(db: &dyn crate::baz::HirDatabase) { + db.metho$0 + } +} + "#, + expect![[r#""#]], + ); + } } -- cgit v1.2.3