Skip to content

Commit 56a7d24

Browse files
Disable unqualified assoc items completion for now
1 parent 8794324 commit 56a7d24

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

crates/ide_assists/src/handlers/qualify_path.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ fn main() {
536536
}
537537

538538
#[test]
539+
#[ignore = "FIXME: non-trait assoc items completion is unsupported yet, see FIXME in the import_assets.rs for more details"]
539540
fn associated_struct_const_unqualified() {
540541
check_assist(
541542
qualify_path,

crates/ide_completion/src/completions/flyimport.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ fn main() {
949949
}
950950

951951
#[test]
952-
fn local_assoc_items_are_omitted() {
952+
fn unqualified_assoc_items_are_omitted() {
953953
check(
954954
r#"
955955
mod something {

crates/ide_db/src/helpers/import_assets.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,14 @@ fn path_applicable_imports(
256256
sema,
257257
current_crate,
258258
path_candidate.name.clone(),
259-
// unqualified assoc items are not valid syntax
259+
// FIXME: we could look up assoc items by the input and propose those in completion,
260+
// but that requries more preparation first:
261+
// * store non-trait assoc items in import_map to fully enable this lookup
262+
// * ensure that does not degrade the performance (bencmark it)
263+
// * write more logic to check for corresponding trait presence requirement (we're unable to flyimport multiple item right now)
264+
// * improve the associated completion item matching and/or scoring to ensure no noisy completions appear
265+
//
266+
// see also an ignored test under FIXME comment in the qualify_path.rs module
260267
AssocItemSearch::Exclude,
261268
Some(DEFAULT_QUERY_SEARCH_LIMIT),
262269
)

0 commit comments

Comments
 (0)