From 469301b603af8f9064d126ad65093a1d41e213ac Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Feb 2019 21:28:23 +0300 Subject: [PATCH] use better label for &mut ref completion --- .../src/completion/complete_postfix.rs | 2 +- ...ion_works_for_trivial_path_expression.snap | 52 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs index d1f6b94331e..cf8c6326931 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 6f435144519..d3e53e4e8b1 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 @@ -80,31 +80,6 @@ expression: kind_completions } ) }, - CompletionItem { - completion_kind: Postfix, - label: "mref", - kind: None, - detail: Some( - "&mut expr" - ), - documentation: None, - lookup: None, - insert_text: Some( - "&mut bar" - ), - insert_text_format: Snippet, - source_range: [76; 76), - text_edit: Some( - TextEdit { - atoms: [ - AtomTextEdit { - delete: [72; 76), - insert: "" - } - ] - } - ) - }, CompletionItem { completion_kind: Postfix, label: "not", @@ -155,6 +130,31 @@ expression: kind_completions } ) }, + CompletionItem { + completion_kind: Postfix, + label: "refm", + kind: None, + detail: Some( + "&mut expr" + ), + documentation: None, + lookup: None, + insert_text: Some( + "&mut bar" + ), + insert_text_format: Snippet, + source_range: [76; 76), + text_edit: Some( + TextEdit { + atoms: [ + AtomTextEdit { + delete: [72; 76), + insert: "" + } + ] + } + ) + }, CompletionItem { completion_kind: Postfix, label: "while",