aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-24 00:48:32 +0100
committerAleksey Kladov <[email protected]>2020-04-24 00:48:32 +0100
commit647683b9bbbbac209b7cb1d2d1c2e1d50ffdfd11 (patch)
tree1623878601fd70fedf6f86938cd12b4a9a597598 /crates
parent09a4b78775809677473b39505796785242bcee2f (diff)
Add test marks
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide/src/completion/presentation.rs4
-rw-r--r--crates/ra_ide/src/marks.rs2
2 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index 6c0e32408..78df9cbdb 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -311,12 +311,14 @@ pub(crate) fn compute_score(
311 name: &str, 311 name: &str,
312) -> Option<CompletionScore> { 312) -> Option<CompletionScore> {
313 let (active_name, active_type) = if let Some(record_field) = &ctx.record_field_syntax { 313 let (active_name, active_type) = if let Some(record_field) = &ctx.record_field_syntax {
314 tested_by!(test_struct_field_completion_in_record_lit);
314 let (struct_field, _local) = ctx.sema.resolve_record_field(record_field)?; 315 let (struct_field, _local) = ctx.sema.resolve_record_field(record_field)?;
315 ( 316 (
316 struct_field.name(ctx.db).to_string(), 317 struct_field.name(ctx.db).to_string(),
317 struct_field.signature_ty(ctx.db).display(ctx.db).to_string(), 318 struct_field.signature_ty(ctx.db).display(ctx.db).to_string(),
318 ) 319 )
319 } else if let Some(active_parameter) = &ctx.active_parameter { 320 } else if let Some(active_parameter) = &ctx.active_parameter {
321 tested_by!(test_struct_field_completion_in_func_call);
320 (active_parameter.name.clone(), active_parameter.ty.clone()) 322 (active_parameter.name.clone(), active_parameter.ty.clone())
321 } else { 323 } else {
322 return None; 324 return None;
@@ -1072,6 +1074,7 @@ mod tests {
1072 1074
1073 #[test] 1075 #[test]
1074 fn test_struct_field_completion_in_func_call() { 1076 fn test_struct_field_completion_in_func_call() {
1077 covers!(test_struct_field_completion_in_func_call);
1075 assert_debug_snapshot!( 1078 assert_debug_snapshot!(
1076 do_reference_completion( 1079 do_reference_completion(
1077 r" 1080 r"
@@ -1161,6 +1164,7 @@ mod tests {
1161 1164
1162 #[test] 1165 #[test]
1163 fn test_struct_field_completion_in_record_lit() { 1166 fn test_struct_field_completion_in_record_lit() {
1167 covers!(test_struct_field_completion_in_func_call);
1164 assert_debug_snapshot!( 1168 assert_debug_snapshot!(
1165 do_reference_completion( 1169 do_reference_completion(
1166 r" 1170 r"
diff --git a/crates/ra_ide/src/marks.rs b/crates/ra_ide/src/marks.rs
index eee44e886..bea30fe2a 100644
--- a/crates/ra_ide/src/marks.rs
+++ b/crates/ra_ide/src/marks.rs
@@ -9,4 +9,6 @@ test_utils::marks!(
9 search_filters_by_range 9 search_filters_by_range
10 dont_insert_macro_call_parens_unncessary 10 dont_insert_macro_call_parens_unncessary
11 self_fulfilling_completion 11 self_fulfilling_completion
12 test_struct_field_completion_in_func_call
13 test_struct_field_completion_in_record_lit
12); 14);