aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-08 21:19:31 +0000
committerGitHub <[email protected]>2021-03-08 21:19:31 +0000
commitc48478621fe9b50cb19bfd0ea4a5c2ff0de5d6ac (patch)
tree3905029a42c8bb6c5d363753b34cd6b5dd43f4d5 /crates/ide_db/src/helpers
parentc5189a22ccf4c28e309e4189defbb88b83bb2aea (diff)
parentfc9eed4836dfc88fe2893c81b015ab440cea2ba6 (diff)
Merge #7924
7924: Use upstream cov-mark r=matklad a=lnicola Closes #7922 But doesn't remove any dependency, unfortunately. Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/ide_db/src/helpers')
-rw-r--r--crates/ide_db/src/helpers/insert_use.rs7
-rw-r--r--crates/ide_db/src/helpers/insert_use/tests.rs6
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};
16use test_utils::mark;
17 16
18#[derive(Clone, Copy, Debug, PartialEq, Eq)] 17#[derive(Clone, Copy, Debug, PartialEq, Eq)]
19pub struct InsertUseConfig { 18pub 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]
53fn insert_start_indent() { 53fn 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]
122fn insert_end_indent() { 122fn 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]
257fn insert_empty_module() { 257fn 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 {}",