diff options
Diffstat (limited to 'crates/ide_completion/src/completions/keyword.rs')
-rw-r--r-- | crates/ide_completion/src/completions/keyword.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ide_completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs index 03c6dd454..80aa9fb06 100644 --- a/crates/ide_completion/src/completions/keyword.rs +++ b/crates/ide_completion/src/completions/keyword.rs | |||
@@ -3,7 +3,6 @@ | |||
3 | use std::iter; | 3 | use std::iter; |
4 | 4 | ||
5 | use syntax::SyntaxKind; | 5 | use syntax::SyntaxKind; |
6 | use test_utils::mark; | ||
7 | 6 | ||
8 | use crate::{CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions}; | 7 | use crate::{CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions}; |
9 | 8 | ||
@@ -47,11 +46,11 @@ pub(crate) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC | |||
47 | 46 | ||
48 | pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionContext) { | 47 | pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionContext) { |
49 | if ctx.token.kind() == SyntaxKind::COMMENT { | 48 | if ctx.token.kind() == SyntaxKind::COMMENT { |
50 | mark::hit!(no_keyword_completion_in_comments); | 49 | cov_mark::hit!(no_keyword_completion_in_comments); |
51 | return; | 50 | return; |
52 | } | 51 | } |
53 | if ctx.record_lit_syntax.is_some() { | 52 | if ctx.record_lit_syntax.is_some() { |
54 | mark::hit!(no_keyword_completion_in_record_lit); | 53 | cov_mark::hit!(no_keyword_completion_in_record_lit); |
55 | return; | 54 | return; |
56 | } | 55 | } |
57 | 56 | ||
@@ -172,7 +171,7 @@ fn add_keyword(ctx: &CompletionContext, acc: &mut Completions, kw: &str, snippet | |||
172 | Some(cap) => { | 171 | Some(cap) => { |
173 | let tmp; | 172 | let tmp; |
174 | let snippet = if snippet.ends_with('}') && ctx.incomplete_let { | 173 | let snippet = if snippet.ends_with('}') && ctx.incomplete_let { |
175 | mark::hit!(let_semi); | 174 | cov_mark::hit!(let_semi); |
176 | tmp = format!("{};", snippet); | 175 | tmp = format!("{};", snippet); |
177 | &tmp | 176 | &tmp |
178 | } else { | 177 | } else { |
@@ -188,7 +187,6 @@ fn add_keyword(ctx: &CompletionContext, acc: &mut Completions, kw: &str, snippet | |||
188 | #[cfg(test)] | 187 | #[cfg(test)] |
189 | mod tests { | 188 | mod tests { |
190 | use expect_test::{expect, Expect}; | 189 | use expect_test::{expect, Expect}; |
191 | use test_utils::mark; | ||
192 | 190 | ||
193 | use crate::{ | 191 | use crate::{ |
194 | test_utils::{check_edit, completion_list}, | 192 | test_utils::{check_edit, completion_list}, |
@@ -494,7 +492,7 @@ fn quux() -> i32 { | |||
494 | 492 | ||
495 | #[test] | 493 | #[test] |
496 | fn no_keyword_completion_in_comments() { | 494 | fn no_keyword_completion_in_comments() { |
497 | mark::check!(no_keyword_completion_in_comments); | 495 | cov_mark::check!(no_keyword_completion_in_comments); |
498 | check( | 496 | check( |
499 | r#" | 497 | r#" |
500 | fn test() { | 498 | fn test() { |
@@ -599,7 +597,7 @@ struct Foo { | |||
599 | 597 | ||
600 | #[test] | 598 | #[test] |
601 | fn skip_struct_initializer() { | 599 | fn skip_struct_initializer() { |
602 | mark::check!(no_keyword_completion_in_record_lit); | 600 | cov_mark::check!(no_keyword_completion_in_record_lit); |
603 | check( | 601 | check( |
604 | r#" | 602 | r#" |
605 | struct Foo { | 603 | struct Foo { |
@@ -643,7 +641,7 @@ fn foo() { | |||
643 | 641 | ||
644 | #[test] | 642 | #[test] |
645 | fn let_semi() { | 643 | fn let_semi() { |
646 | mark::check!(let_semi); | 644 | cov_mark::check!(let_semi); |
647 | check_edit( | 645 | check_edit( |
648 | "match", | 646 | "match", |
649 | r#" | 647 | r#" |