aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-06-24 11:21:36 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-06-24 11:21:36 +0100
commitf6340022c1ce9bfa716b4b61800cdc8c51260a93 (patch)
treeaed0e60c024820575da1ad8efa3c114a8e038864 /crates/ra_ide_api/src
parent67ecc88f664818cf04729286afa10ba70ad1a9dd (diff)
parentbf7a35294d92381ce85cbb6e8a300a270a4d6a81 (diff)
Merge #1429
1429: Add box postfix completion r=matklad a=kanru Co-authored-by: Kan-Ru Chen <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/completion/complete_postfix.rs2
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap9
2 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs
index 278b1b797..e20a12e2a 100644
--- a/crates/ra_ide_api/src/completion/complete_postfix.rs
+++ b/crates/ra_ide_api/src/completion/complete_postfix.rs
@@ -51,6 +51,8 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
51 ) 51 )
52 .add_to(acc); 52 .add_to(acc);
53 postfix_snippet(ctx, "dbg", "dbg!(expr)", &format!("dbg!({})", receiver_text)).add_to(acc); 53 postfix_snippet(ctx, "dbg", "dbg!(expr)", &format!("dbg!({})", receiver_text)).add_to(acc);
54 postfix_snippet(ctx, "box", "Box::new(expr)", &format!("Box::new({})", receiver_text))
55 .add_to(acc);
54 } 56 }
55} 57}
56 58
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 fcb292596..c1a40b7b4 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,11 +1,18 @@
1--- 1---
2created: "2019-05-23T22:23:35.118738523Z" 2created: "2019-06-23T13:01:08.775536006Z"
3creator: [email protected] 3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs 4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions 5expression: kind_completions
6--- 6---
7[ 7[
8 CompletionItem { 8 CompletionItem {
9 label: "box",
10 source_range: [76; 76),
11 delete: [72; 76),
12 insert: "Box::new(bar)",
13 detail: "Box::new(expr)",
14 },
15 CompletionItem {
9 label: "dbg", 16 label: "dbg",
10 source_range: [76; 76), 17 source_range: [76; 76),
11 delete: [72; 76), 18 delete: [72; 76),