diff options
Diffstat (limited to 'crates/ide_assists/src/handlers/qualify_path.rs')
-rw-r--r-- | crates/ide_assists/src/handlers/qualify_path.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/crates/ide_assists/src/handlers/qualify_path.rs b/crates/ide_assists/src/handlers/qualify_path.rs index d84ca0e55..d3e34e540 100644 --- a/crates/ide_assists/src/handlers/qualify_path.rs +++ b/crates/ide_assists/src/handlers/qualify_path.rs | |||
@@ -8,7 +8,6 @@ use syntax::{ | |||
8 | ast::{make, ArgListOwner}, | 8 | ast::{make, ArgListOwner}, |
9 | AstNode, | 9 | AstNode, |
10 | }; | 10 | }; |
11 | use test_utils::mark; | ||
12 | 11 | ||
13 | use crate::{ | 12 | use crate::{ |
14 | assist_context::{AssistContext, Assists}, | 13 | assist_context::{AssistContext, Assists}, |
@@ -47,25 +46,25 @@ pub(crate) fn qualify_path(acc: &mut Assists, ctx: &AssistContext) -> Option<()> | |||
47 | let qualify_candidate = match candidate { | 46 | let qualify_candidate = match candidate { |
48 | ImportCandidate::Path(candidate) => { | 47 | ImportCandidate::Path(candidate) => { |
49 | if candidate.qualifier.is_some() { | 48 | if candidate.qualifier.is_some() { |
50 | mark::hit!(qualify_path_qualifier_start); | 49 | cov_mark::hit!(qualify_path_qualifier_start); |
51 | let path = ast::Path::cast(syntax_under_caret)?; | 50 | let path = ast::Path::cast(syntax_under_caret)?; |
52 | let (prev_segment, segment) = (path.qualifier()?.segment()?, path.segment()?); | 51 | let (prev_segment, segment) = (path.qualifier()?.segment()?, path.segment()?); |
53 | QualifyCandidate::QualifierStart(segment, prev_segment.generic_arg_list()) | 52 | QualifyCandidate::QualifierStart(segment, prev_segment.generic_arg_list()) |
54 | } else { | 53 | } else { |
55 | mark::hit!(qualify_path_unqualified_name); | 54 | cov_mark::hit!(qualify_path_unqualified_name); |
56 | let path = ast::Path::cast(syntax_under_caret)?; | 55 | let path = ast::Path::cast(syntax_under_caret)?; |
57 | let generics = path.segment()?.generic_arg_list(); | 56 | let generics = path.segment()?.generic_arg_list(); |
58 | QualifyCandidate::UnqualifiedName(generics) | 57 | QualifyCandidate::UnqualifiedName(generics) |
59 | } | 58 | } |
60 | } | 59 | } |
61 | ImportCandidate::TraitAssocItem(_) => { | 60 | ImportCandidate::TraitAssocItem(_) => { |
62 | mark::hit!(qualify_path_trait_assoc_item); | 61 | cov_mark::hit!(qualify_path_trait_assoc_item); |
63 | let path = ast::Path::cast(syntax_under_caret)?; | 62 | let path = ast::Path::cast(syntax_under_caret)?; |
64 | let (qualifier, segment) = (path.qualifier()?, path.segment()?); | 63 | let (qualifier, segment) = (path.qualifier()?, path.segment()?); |
65 | QualifyCandidate::TraitAssocItem(qualifier, segment) | 64 | QualifyCandidate::TraitAssocItem(qualifier, segment) |
66 | } | 65 | } |
67 | ImportCandidate::TraitMethod(_) => { | 66 | ImportCandidate::TraitMethod(_) => { |
68 | mark::hit!(qualify_path_trait_method); | 67 | cov_mark::hit!(qualify_path_trait_method); |
69 | let mcall_expr = ast::MethodCallExpr::cast(syntax_under_caret)?; | 68 | let mcall_expr = ast::MethodCallExpr::cast(syntax_under_caret)?; |
70 | QualifyCandidate::TraitMethod(ctx.sema.db, mcall_expr) | 69 | QualifyCandidate::TraitMethod(ctx.sema.db, mcall_expr) |
71 | } | 70 | } |
@@ -212,7 +211,7 @@ mod tests { | |||
212 | 211 | ||
213 | #[test] | 212 | #[test] |
214 | fn applicable_when_found_an_import_partial() { | 213 | fn applicable_when_found_an_import_partial() { |
215 | mark::check!(qualify_path_unqualified_name); | 214 | cov_mark::check!(qualify_path_unqualified_name); |
216 | check_assist( | 215 | check_assist( |
217 | qualify_path, | 216 | qualify_path, |
218 | r" | 217 | r" |
@@ -504,7 +503,7 @@ fn main() { | |||
504 | 503 | ||
505 | #[test] | 504 | #[test] |
506 | fn associated_struct_const() { | 505 | fn associated_struct_const() { |
507 | mark::check!(qualify_path_qualifier_start); | 506 | cov_mark::check!(qualify_path_qualifier_start); |
508 | check_assist( | 507 | check_assist( |
509 | qualify_path, | 508 | qualify_path, |
510 | r" | 509 | r" |
@@ -605,7 +604,7 @@ fn main() { | |||
605 | 604 | ||
606 | #[test] | 605 | #[test] |
607 | fn associated_trait_const() { | 606 | fn associated_trait_const() { |
608 | mark::check!(qualify_path_trait_assoc_item); | 607 | cov_mark::check!(qualify_path_trait_assoc_item); |
609 | check_assist( | 608 | check_assist( |
610 | qualify_path, | 609 | qualify_path, |
611 | r" | 610 | r" |
@@ -675,7 +674,7 @@ fn main() { | |||
675 | 674 | ||
676 | #[test] | 675 | #[test] |
677 | fn trait_method() { | 676 | fn trait_method() { |
678 | mark::check!(qualify_path_trait_method); | 677 | cov_mark::check!(qualify_path_trait_method); |
679 | check_assist( | 678 | check_assist( |
680 | qualify_path, | 679 | qualify_path, |
681 | r" | 680 | r" |