Add box postfix completion

This commit is contained in:
Kan-Ru Chen 2019-06-23 10:41:43 +09:00
parent 7d79be3280
commit bf7a35294d
2 changed files with 10 additions and 1 deletions

View File

@ -51,6 +51,8 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
)
.add_to(acc);
postfix_snippet(ctx, "dbg", "dbg!(expr)", &format!("dbg!({})", receiver_text)).add_to(acc);
postfix_snippet(ctx, "box", "Box::new(expr)", &format!("Box::new({})", receiver_text))
.add_to(acc);
}
}

View File

@ -1,10 +1,17 @@
---
created: "2019-05-23T22:23:35.118738523Z"
created: "2019-06-23T13:01:08.775536006Z"
creator: insta@0.8.1
source: crates/ra_ide_api/src/completion/completion_item.rs
expression: kind_completions
---
[
CompletionItem {
label: "box",
source_range: [76; 76),
delete: [72; 76),
insert: "Box::new(bar)",
detail: "Box::new(expr)",
},
CompletionItem {
label: "dbg",
source_range: [76; 76),