From 6a8d47e7f05545de335107262ceca2ef1742888f Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 10 May 2021 21:03:50 +0200 Subject: Give MergeBehaviour variants better names --- crates/ide_assists/src/handlers/merge_imports.rs | 4 ++-- crates/ide_assists/src/tests.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide_assists') diff --git a/crates/ide_assists/src/handlers/merge_imports.rs b/crates/ide_assists/src/handlers/merge_imports.rs index add7b8e37..3cd090737 100644 --- a/crates/ide_assists/src/handlers/merge_imports.rs +++ b/crates/ide_assists/src/handlers/merge_imports.rs @@ -27,14 +27,14 @@ pub(crate) fn merge_imports(acc: &mut Assists, ctx: &AssistContext) -> Option<() if let Some(use_item) = tree.syntax().parent().and_then(ast::Use::cast) { let (merged, to_remove) = next_prev().filter_map(|dir| neighbor(&use_item, dir)).find_map(|use_item2| { - try_merge_imports(&use_item, &use_item2, MergeBehavior::Full).zip(Some(use_item2)) + try_merge_imports(&use_item, &use_item2, MergeBehavior::Crate).zip(Some(use_item2)) })?; imports = Some((use_item, merged, to_remove)); } else { let (merged, to_remove) = next_prev().filter_map(|dir| neighbor(&tree, dir)).find_map(|use_tree| { - try_merge_trees(&tree, &use_tree, MergeBehavior::Full).zip(Some(use_tree)) + try_merge_trees(&tree, &use_tree, MergeBehavior::Crate).zip(Some(use_tree)) })?; uses = Some((tree.clone(), merged, to_remove)) diff --git a/crates/ide_assists/src/tests.rs b/crates/ide_assists/src/tests.rs index 9c2847998..0d3969c36 100644 --- a/crates/ide_assists/src/tests.rs +++ b/crates/ide_assists/src/tests.rs @@ -21,7 +21,7 @@ pub(crate) const TEST_CONFIG: AssistConfig = AssistConfig { snippet_cap: SnippetCap::new(true), allowed: None, insert_use: InsertUseConfig { - merge: Some(MergeBehavior::Full), + merge: Some(MergeBehavior::Crate), prefix_kind: hir::PrefixKind::Plain, group: true, }, -- cgit v1.2.3