diff options
Diffstat (limited to 'crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs')
-rw-r--r-- | crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs b/crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs index f3bc6cf39..36d2e0331 100644 --- a/crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -1,6 +1,5 @@ | |||
1 | use ide_db::helpers::insert_use::{insert_use, ImportScope}; | 1 | use ide_db::helpers::insert_use::{insert_use, ImportScope}; |
2 | use syntax::{algo::SyntaxRewriter, ast, match_ast, AstNode, SyntaxNode}; | 2 | use syntax::{algo::SyntaxRewriter, ast, match_ast, AstNode, SyntaxNode}; |
3 | use test_utils::mark; | ||
4 | 3 | ||
5 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 4 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
6 | 5 | ||
@@ -27,7 +26,7 @@ pub(crate) fn replace_qualified_name_with_use( | |||
27 | return None; | 26 | return None; |
28 | } | 27 | } |
29 | if path.qualifier().is_none() { | 28 | if path.qualifier().is_none() { |
30 | mark::hit!(dont_import_trivial_paths); | 29 | cov_mark::hit!(dont_import_trivial_paths); |
31 | return None; | 30 | return None; |
32 | } | 31 | } |
33 | 32 | ||
@@ -44,7 +43,7 @@ pub(crate) fn replace_qualified_name_with_use( | |||
44 | let mut rewriter = SyntaxRewriter::default(); | 43 | let mut rewriter = SyntaxRewriter::default(); |
45 | shorten_paths(&mut rewriter, syntax.clone(), &path); | 44 | shorten_paths(&mut rewriter, syntax.clone(), &path); |
46 | if let Some(ref import_scope) = ImportScope::from(syntax.clone()) { | 45 | if let Some(ref import_scope) = ImportScope::from(syntax.clone()) { |
47 | rewriter += insert_use(import_scope, path, ctx.config.insert_use.merge); | 46 | rewriter += insert_use(import_scope, path, ctx.config.insert_use); |
48 | builder.rewrite(rewriter); | 47 | builder.rewrite(rewriter); |
49 | } | 48 | } |
50 | }, | 49 | }, |
@@ -458,7 +457,7 @@ impl Debug for Foo { | |||
458 | 457 | ||
459 | #[test] | 458 | #[test] |
460 | fn dont_import_trivial_paths() { | 459 | fn dont_import_trivial_paths() { |
461 | mark::check!(dont_import_trivial_paths); | 460 | cov_mark::check!(dont_import_trivial_paths); |
462 | check_assist_not_applicable( | 461 | check_assist_not_applicable( |
463 | replace_qualified_name_with_use, | 462 | replace_qualified_name_with_use, |
464 | r" | 463 | r" |