aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/render.rs')
-rw-r--r--crates/ide_completion/src/render.rs15
1 files changed, 3 insertions, 12 deletions
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs
index 905f0b197..3e1bff4d6 100644
--- a/crates/ide_completion/src/render.rs
+++ b/crates/ide_completion/src/render.rs
@@ -119,17 +119,10 @@ impl<'a> RenderContext<'a> {
119 node.docs(self.db()) 119 node.docs(self.db())
120 } 120 }
121 121
122 // FIXME delete this method in favor of directly using the fields
123 // on CompletionContext
122 fn expected_name_and_type(&self) -> Option<(String, Type)> { 124 fn expected_name_and_type(&self) -> Option<(String, Type)> {
123 if let Some(record_field) = &self.completion.record_field_syntax { 125 Some((self.completion.expected_name.clone()?, self.completion.expected_type.clone()?))
124 cov_mark::hit!(record_field_type_match);
125 let (struct_field, _local) = self.completion.sema.resolve_record_field(record_field)?;
126 Some((struct_field.name(self.db()).to_string(), struct_field.signature_ty(self.db())))
127 } else if let Some(active_parameter) = &self.completion.active_parameter {
128 cov_mark::hit!(active_param_type_match);
129 Some((active_parameter.name.clone(), active_parameter.ty.clone()))
130 } else {
131 None
132 }
133 } 126 }
134} 127}
135 128
@@ -852,7 +845,6 @@ fn foo(xs: Vec<i128>)
852 845
853 #[test] 846 #[test]
854 fn active_param_relevance() { 847 fn active_param_relevance() {
855 cov_mark::check!(active_param_type_match);
856 check_relevance( 848 check_relevance(
857 r#" 849 r#"
858struct S { foo: i64, bar: u32, baz: u32 } 850struct S { foo: i64, bar: u32, baz: u32 }
@@ -869,7 +861,6 @@ fn foo(s: S) { test(s.$0) }
869 861
870 #[test] 862 #[test]
871 fn record_field_relevances() { 863 fn record_field_relevances() {
872 cov_mark::check!(record_field_type_match);
873 check_relevance( 864 check_relevance(
874 r#" 865 r#"
875struct A { foo: i64, bar: u32, baz: u32 } 866struct A { foo: i64, bar: u32, baz: u32 }