File tree Expand file tree Collapse file tree
crates/ide-completion/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ pub(crate) fn import_on_the_fly_path(
133133 let potential_import_name = import_name ( ctx) ;
134134 let qualifier = match qualified {
135135 Qualified :: With { path, .. } => Some ( path. clone ( ) ) ,
136- _ => None ,
136+ Qualified :: TypeAnchor { .. } => return None ,
137+ Qualified :: No | Qualified :: Absolute => None ,
137138 } ;
138139 let import_assets = import_assets_for_path (
139140 ctx,
Original file line number Diff line number Diff line change @@ -1242,6 +1242,39 @@ impl Bar for Foo {
12421242 ) ;
12431243}
12441244
1245+ #[ test]
1246+ fn no_flyimports_type_anchor ( ) {
1247+ check (
1248+ r#"
1249+ mod m {
1250+ pub fn foo() {}
1251+ }
1252+ struct Bar;
1253+ trait Foo {}
1254+ impl Foo for Bar {}
1255+ fn main() {
1256+ <Bar as Foo>::foo$0
1257+ }
1258+ "# ,
1259+ expect ! [ [ r#""# ] ] ,
1260+ ) ;
1261+
1262+ check (
1263+ r#"
1264+ mod m {
1265+ pub fn foo() {}
1266+ }
1267+ struct Bar;
1268+ trait Foo {}
1269+ impl Foo for Bar {}
1270+ fn main() {
1271+ <Bar>::foo$0
1272+ }
1273+ "# ,
1274+ expect ! [ [ r#""# ] ] ,
1275+ ) ;
1276+ }
1277+
12451278#[ test]
12461279fn no_inherent_candidates_proposed ( ) {
12471280 check (
You can’t perform that action at this time.
0 commit comments