diff options
author | Laurențiu Nicola <[email protected]> | 2021-03-08 20:19:44 +0000 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2021-03-08 20:19:44 +0000 |
commit | fc9eed4836dfc88fe2893c81b015ab440cea2ba6 (patch) | |
tree | 3905029a42c8bb6c5d363753b34cd6b5dd43f4d5 /crates/ide_db/src/helpers | |
parent | c5189a22ccf4c28e309e4189defbb88b83bb2aea (diff) |
Use upstream cov-mark
Diffstat (limited to 'crates/ide_db/src/helpers')
-rw-r--r-- | crates/ide_db/src/helpers/insert_use.rs | 7 | ||||
-rw-r--r-- | crates/ide_db/src/helpers/insert_use/tests.rs | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/crates/ide_db/src/helpers/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs index f52aee344..df66d8ea0 100644 --- a/crates/ide_db/src/helpers/insert_use.rs +++ b/crates/ide_db/src/helpers/insert_use.rs | |||
@@ -13,7 +13,6 @@ use syntax::{ | |||
13 | }, | 13 | }, |
14 | AstToken, InsertPosition, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken, | 14 | AstToken, InsertPosition, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken, |
15 | }; | 15 | }; |
16 | use test_utils::mark; | ||
17 | 16 | ||
18 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | 17 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
19 | pub struct InsertUseConfig { | 18 | pub struct InsertUseConfig { |
@@ -138,7 +137,7 @@ pub fn insert_use<'a>( | |||
138 | 137 | ||
139 | if add_blank.has_before() { | 138 | if add_blank.has_before() { |
140 | if let Some(indent) = indent.clone() { | 139 | if let Some(indent) = indent.clone() { |
141 | mark::hit!(insert_use_indent_before); | 140 | cov_mark::hit!(insert_use_indent_before); |
142 | buf.push(indent); | 141 | buf.push(indent); |
143 | } | 142 | } |
144 | } | 143 | } |
@@ -156,11 +155,11 @@ pub fn insert_use<'a>( | |||
156 | // only add indentation *after* our stuff if there's another node directly after it | 155 | // only add indentation *after* our stuff if there's another node directly after it |
157 | if add_blank.has_after() && matches!(insert_position, InsertPosition::Before(_)) { | 156 | if add_blank.has_after() && matches!(insert_position, InsertPosition::Before(_)) { |
158 | if let Some(indent) = indent { | 157 | if let Some(indent) = indent { |
159 | mark::hit!(insert_use_indent_after); | 158 | cov_mark::hit!(insert_use_indent_after); |
160 | buf.push(indent); | 159 | buf.push(indent); |
161 | } | 160 | } |
162 | } else if add_blank.has_after() && matches!(insert_position, InsertPosition::After(_)) { | 161 | } else if add_blank.has_after() && matches!(insert_position, InsertPosition::After(_)) { |
163 | mark::hit!(insert_use_no_indent_after); | 162 | cov_mark::hit!(insert_use_no_indent_after); |
164 | } | 163 | } |
165 | 164 | ||
166 | buf | 165 | buf |
diff --git a/crates/ide_db/src/helpers/insert_use/tests.rs b/crates/ide_db/src/helpers/insert_use/tests.rs index 67d0d6fb6..3d151e629 100644 --- a/crates/ide_db/src/helpers/insert_use/tests.rs +++ b/crates/ide_db/src/helpers/insert_use/tests.rs | |||
@@ -51,7 +51,7 @@ use std::bar::G;", | |||
51 | 51 | ||
52 | #[test] | 52 | #[test] |
53 | fn insert_start_indent() { | 53 | fn insert_start_indent() { |
54 | mark::check!(insert_use_indent_after); | 54 | cov_mark::check!(insert_use_indent_after); |
55 | check_none( | 55 | check_none( |
56 | "std::bar::AA", | 56 | "std::bar::AA", |
57 | r" | 57 | r" |
@@ -120,7 +120,7 @@ use std::bar::ZZ;", | |||
120 | 120 | ||
121 | #[test] | 121 | #[test] |
122 | fn insert_end_indent() { | 122 | fn insert_end_indent() { |
123 | mark::check!(insert_use_indent_before); | 123 | cov_mark::check!(insert_use_indent_before); |
124 | check_none( | 124 | check_none( |
125 | "std::bar::ZZ", | 125 | "std::bar::ZZ", |
126 | r" | 126 | r" |
@@ -255,7 +255,7 @@ fn insert_empty_file() { | |||
255 | 255 | ||
256 | #[test] | 256 | #[test] |
257 | fn insert_empty_module() { | 257 | fn insert_empty_module() { |
258 | mark::check!(insert_use_no_indent_after); | 258 | cov_mark::check!(insert_use_no_indent_after); |
259 | check( | 259 | check( |
260 | "foo::bar", | 260 | "foo::bar", |
261 | "mod x {}", | 261 | "mod x {}", |