mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Merge #1429
1429: Add box postfix completion r=matklad a=kanru Co-authored-by: Kan-Ru Chen <kanru@kanru.info>
This commit is contained in:
commit
f6340022c1
2 changed files with 10 additions and 1 deletions
|
@ -51,6 +51,8 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
)
|
)
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
postfix_snippet(ctx, "dbg", "dbg!(expr)", &format!("dbg!({})", receiver_text)).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
|
creator: insta@0.8.1
|
||||||
source: crates/ra_ide_api/src/completion/completion_item.rs
|
source: crates/ra_ide_api/src/completion/completion_item.rs
|
||||||
expression: kind_completions
|
expression: kind_completions
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
CompletionItem {
|
||||||
|
label: "box",
|
||||||
|
source_range: [76; 76),
|
||||||
|
delete: [72; 76),
|
||||||
|
insert: "Box::new(bar)",
|
||||||
|
detail: "Box::new(expr)",
|
||||||
|
},
|
||||||
CompletionItem {
|
CompletionItem {
|
||||||
label: "dbg",
|
label: "dbg",
|
||||||
source_range: [76; 76),
|
source_range: [76; 76),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue