diff options
Diffstat (limited to 'crates/ide_assists/src/handlers/change_visibility.rs')
-rw-r--r-- | crates/ide_assists/src/handlers/change_visibility.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ide_assists/src/handlers/change_visibility.rs b/crates/ide_assists/src/handlers/change_visibility.rs index ac8c44124..ec99a5505 100644 --- a/crates/ide_assists/src/handlers/change_visibility.rs +++ b/crates/ide_assists/src/handlers/change_visibility.rs | |||
@@ -4,7 +4,6 @@ use syntax::{ | |||
4 | SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT, TYPE_ALIAS, VISIBILITY}, | 4 | SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT, TYPE_ALIAS, VISIBILITY}, |
5 | T, | 5 | T, |
6 | }; | 6 | }; |
7 | use test_utils::mark; | ||
8 | 7 | ||
9 | use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; | 8 | use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; |
10 | 9 | ||
@@ -56,7 +55,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
56 | } else if let Some(field_name) = ctx.find_node_at_offset::<ast::Name>() { | 55 | } else if let Some(field_name) = ctx.find_node_at_offset::<ast::Name>() { |
57 | let field = field_name.syntax().ancestors().find_map(ast::RecordField::cast)?; | 56 | let field = field_name.syntax().ancestors().find_map(ast::RecordField::cast)?; |
58 | if field.name()? != field_name { | 57 | if field.name()? != field_name { |
59 | mark::hit!(change_visibility_field_false_positive); | 58 | cov_mark::hit!(change_visibility_field_false_positive); |
60 | return None; | 59 | return None; |
61 | } | 60 | } |
62 | if field.visibility().is_some() { | 61 | if field.visibility().is_some() { |
@@ -110,8 +109,6 @@ fn change_vis(acc: &mut Assists, vis: ast::Visibility) -> Option<()> { | |||
110 | 109 | ||
111 | #[cfg(test)] | 110 | #[cfg(test)] |
112 | mod tests { | 111 | mod tests { |
113 | use test_utils::mark; | ||
114 | |||
115 | use crate::tests::{check_assist, check_assist_not_applicable, check_assist_target}; | 112 | use crate::tests::{check_assist, check_assist_not_applicable, check_assist_target}; |
116 | 113 | ||
117 | use super::*; | 114 | use super::*; |
@@ -139,7 +136,7 @@ mod tests { | |||
139 | 136 | ||
140 | #[test] | 137 | #[test] |
141 | fn change_visibility_field_false_positive() { | 138 | fn change_visibility_field_false_positive() { |
142 | mark::check!(change_visibility_field_false_positive); | 139 | cov_mark::check!(change_visibility_field_false_positive); |
143 | check_assist_not_applicable( | 140 | check_assist_not_applicable( |
144 | change_visibility, | 141 | change_visibility, |
145 | r"struct S { field: [(); { let $0x = ();}] }", | 142 | r"struct S { field: [(); { let $0x = ();}] }", |