From 469301b603af8f9064d126ad65093a1d41e213ac Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Feb 2019 21:28:23 +0300 Subject: use better label for &mut ref completion --- crates/ra_ide_api/src/completion/complete_postfix.rs | 2 +- ...completion_works_for_trivial_path_expression.snap | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs index d1f6b9433..cf8c63269 100644 --- a/crates/ra_ide_api/src/completion/complete_postfix.rs +++ b/crates/ra_ide_api/src/completion/complete_postfix.rs @@ -32,7 +32,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { let receiver_text = dot_receiver.syntax().text().to_string(); postfix_snippet(ctx, "not", "!expr", &format!("!{}", receiver_text)).add_to(acc); postfix_snippet(ctx, "ref", "&expr", &format!("&{}", receiver_text)).add_to(acc); - postfix_snippet(ctx, "mref", "&mut expr", &format!("&mut {}", receiver_text)).add_to(acc); + postfix_snippet(ctx, "refm", "&mut expr", &format!("&mut {}", receiver_text)).add_to(acc); postfix_snippet(ctx, "if", "if expr {}", &format!("if {} {{$0}}", receiver_text)) .add_to(acc); postfix_snippet( diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap index 6f4351445..d3e53e4e8 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap @@ -1,5 +1,5 @@ --- -created: "2019-02-14T17:38:20.322102467Z" +created: "2019-02-14T18:33:26.102469493Z" creator: insta@0.6.2 source: crates/ra_ide_api/src/completion/completion_item.rs expression: kind_completions @@ -82,15 +82,15 @@ expression: kind_completions }, CompletionItem { completion_kind: Postfix, - label: "mref", + label: "not", kind: None, detail: Some( - "&mut expr" + "!expr" ), documentation: None, lookup: None, insert_text: Some( - "&mut bar" + "!bar" ), insert_text_format: Snippet, source_range: [76; 76), @@ -107,15 +107,15 @@ expression: kind_completions }, CompletionItem { completion_kind: Postfix, - label: "not", + label: "ref", kind: None, detail: Some( - "!expr" + "&expr" ), documentation: None, lookup: None, insert_text: Some( - "!bar" + "&bar" ), insert_text_format: Snippet, source_range: [76; 76), @@ -132,15 +132,15 @@ expression: kind_completions }, CompletionItem { completion_kind: Postfix, - label: "ref", + label: "refm", kind: None, detail: Some( - "&expr" + "&mut expr" ), documentation: None, lookup: None, insert_text: Some( - "&bar" + "&mut bar" ), insert_text_format: Snippet, source_range: [76; 76), -- cgit v1.2.3