mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
Add box postfix completion
This commit is contained in:
parent
7d79be3280
commit
bf7a35294d
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user