diff options
Diffstat (limited to 'crates/ide_completion/src/render.rs')
-rw-r--r-- | crates/ide_completion/src/render.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs index eddaaa6f3..dcfac23c5 100644 --- a/crates/ide_completion/src/render.rs +++ b/crates/ide_completion/src/render.rs | |||
@@ -15,7 +15,6 @@ use hir::{ | |||
15 | }; | 15 | }; |
16 | use ide_db::{helpers::SnippetCap, RootDatabase, SymbolKind}; | 16 | use ide_db::{helpers::SnippetCap, RootDatabase, SymbolKind}; |
17 | use syntax::TextRange; | 17 | use syntax::TextRange; |
18 | use test_utils::mark; | ||
19 | 18 | ||
20 | use crate::{ | 19 | use crate::{ |
21 | item::ImportEdit, CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, | 20 | item::ImportEdit, CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, |
@@ -115,11 +114,11 @@ impl<'a> RenderContext<'a> { | |||
115 | 114 | ||
116 | fn active_name_and_type(&self) -> Option<(String, Type)> { | 115 | fn active_name_and_type(&self) -> Option<(String, Type)> { |
117 | if let Some(record_field) = &self.completion.record_field_syntax { | 116 | if let Some(record_field) = &self.completion.record_field_syntax { |
118 | mark::hit!(record_field_type_match); | 117 | cov_mark::hit!(record_field_type_match); |
119 | let (struct_field, _local) = self.completion.sema.resolve_record_field(record_field)?; | 118 | let (struct_field, _local) = self.completion.sema.resolve_record_field(record_field)?; |
120 | Some((struct_field.name(self.db()).to_string(), struct_field.signature_ty(self.db()))) | 119 | Some((struct_field.name(self.db()).to_string(), struct_field.signature_ty(self.db()))) |
121 | } else if let Some(active_parameter) = &self.completion.active_parameter { | 120 | } else if let Some(active_parameter) = &self.completion.active_parameter { |
122 | mark::hit!(active_param_type_match); | 121 | cov_mark::hit!(active_param_type_match); |
123 | Some((active_parameter.name.clone(), active_parameter.ty.clone())) | 122 | Some((active_parameter.name.clone(), active_parameter.ty.clone())) |
124 | } else { | 123 | } else { |
125 | None | 124 | None |
@@ -269,7 +268,7 @@ impl<'a> Render<'a> { | |||
269 | _ => false, | 268 | _ => false, |
270 | }; | 269 | }; |
271 | if has_non_default_type_params { | 270 | if has_non_default_type_params { |
272 | mark::hit!(inserts_angle_brackets_for_generics); | 271 | cov_mark::hit!(inserts_angle_brackets_for_generics); |
273 | item = item | 272 | item = item |
274 | .lookup_by(local_name.clone()) | 273 | .lookup_by(local_name.clone()) |
275 | .label(format!("{}<…>", local_name)) | 274 | .label(format!("{}<…>", local_name)) |
@@ -358,7 +357,6 @@ mod tests { | |||
358 | use std::cmp::Reverse; | 357 | use std::cmp::Reverse; |
359 | 358 | ||
360 | use expect_test::{expect, Expect}; | 359 | use expect_test::{expect, Expect}; |
361 | use test_utils::mark; | ||
362 | 360 | ||
363 | use crate::{ | 361 | use crate::{ |
364 | test_utils::{check_edit, do_completion, get_all_items, TEST_CONFIG}, | 362 | test_utils::{check_edit, do_completion, get_all_items, TEST_CONFIG}, |
@@ -734,7 +732,7 @@ fn foo(s: S) { s.$0 } | |||
734 | 732 | ||
735 | #[test] | 733 | #[test] |
736 | fn no_call_parens_if_fn_ptr_needed() { | 734 | fn no_call_parens_if_fn_ptr_needed() { |
737 | mark::check!(no_call_parens_if_fn_ptr_needed); | 735 | cov_mark::check!(no_call_parens_if_fn_ptr_needed); |
738 | check_edit( | 736 | check_edit( |
739 | "foo", | 737 | "foo", |
740 | r#" | 738 | r#" |
@@ -758,7 +756,7 @@ fn main() -> ManualVtable { | |||
758 | 756 | ||
759 | #[test] | 757 | #[test] |
760 | fn no_parens_in_use_item() { | 758 | fn no_parens_in_use_item() { |
761 | mark::check!(no_parens_in_use_item); | 759 | cov_mark::check!(no_parens_in_use_item); |
762 | check_edit( | 760 | check_edit( |
763 | "foo", | 761 | "foo", |
764 | r#" | 762 | r#" |
@@ -802,7 +800,7 @@ fn f(foo: &Foo) { foo.foo(); } | |||
802 | 800 | ||
803 | #[test] | 801 | #[test] |
804 | fn inserts_angle_brackets_for_generics() { | 802 | fn inserts_angle_brackets_for_generics() { |
805 | mark::check!(inserts_angle_brackets_for_generics); | 803 | cov_mark::check!(inserts_angle_brackets_for_generics); |
806 | check_edit( | 804 | check_edit( |
807 | "Vec", | 805 | "Vec", |
808 | r#" | 806 | r#" |
@@ -851,7 +849,7 @@ fn foo(xs: Vec<i128>) | |||
851 | 849 | ||
852 | #[test] | 850 | #[test] |
853 | fn active_param_score() { | 851 | fn active_param_score() { |
854 | mark::check!(active_param_type_match); | 852 | cov_mark::check!(active_param_type_match); |
855 | check_scores( | 853 | check_scores( |
856 | r#" | 854 | r#" |
857 | struct S { foo: i64, bar: u32, baz: u32 } | 855 | struct S { foo: i64, bar: u32, baz: u32 } |
@@ -868,7 +866,7 @@ fn foo(s: S) { test(s.$0) } | |||
868 | 866 | ||
869 | #[test] | 867 | #[test] |
870 | fn record_field_scores() { | 868 | fn record_field_scores() { |
871 | mark::check!(record_field_type_match); | 869 | cov_mark::check!(record_field_type_match); |
872 | check_scores( | 870 | check_scores( |
873 | r#" | 871 | r#" |
874 | struct A { foo: i64, bar: u32, baz: u32 } | 872 | struct A { foo: i64, bar: u32, baz: u32 } |