]> git.lizzy.rs Git - rust.git/commitdiff
Disable unqualified assoc items completion for now
authorKirill Bulatov <mail4score@gmail.com>
Sat, 20 Mar 2021 21:04:28 +0000 (23:04 +0200)
committerKirill Bulatov <mail4score@gmail.com>
Sat, 20 Mar 2021 21:08:44 +0000 (23:08 +0200)
crates/ide_assists/src/handlers/qualify_path.rs
crates/ide_completion/src/completions/flyimport.rs
crates/ide_db/src/helpers/import_assets.rs

index e7444f7dbbb0cc6630b826a390435b208adc63ba..f91770a763750cf2559859d66d7139350be91c9f 100644 (file)
@@ -536,6 +536,7 @@ fn main() {
     }
 
     #[test]
+    #[ignore = "FIXME: non-trait assoc items completion is unsupported yet, see FIXME in the import_assets.rs for more details"]
     fn associated_struct_const_unqualified() {
         check_assist(
             qualify_path,
index f6c7d507f1be8c32a58c7b9d4d7c1062b5084c69..eb2cba6319c6cc7d923879d0583e9e83bbc730bd 100644 (file)
@@ -949,7 +949,7 @@ fn main() {
     }
 
     #[test]
-    fn local_assoc_items_are_omitted() {
+    fn unqualified_assoc_items_are_omitted() {
         check(
             r#"
 mod something {
index 6995c3e19bac712754d7bf9653cb1343553428e3..0da7a1a9d5ae488cf27d28775cf89c2efac06020 100644 (file)
@@ -256,7 +256,14 @@ fn path_applicable_imports(
                 sema,
                 current_crate,
                 path_candidate.name.clone(),
-                // unqualified assoc items are not valid syntax
+                // FIXME: we could look up assoc items by the input and propose those in completion,
+                // but that requries more preparation first:
+                // * store non-trait assoc items in import_map to fully enable this lookup
+                // * ensure that does not degrade the performance (bencmark it)
+                // * write more logic to check for corresponding trait presence requirement (we're unable to flyimport multiple item right now)
+                // * improve the associated completion item matching and/or scoring to ensure no noisy completions appear
+                //
+                // see also an ignored test under FIXME comment in the qualify_path.rs module
                 AssocItemSearch::Exclude,
                 Some(DEFAULT_QUERY_SEARCH_LIMIT),
             )