mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Add some postfix snippet
This commit is contained in:
parent
945900bdbf
commit
ca3498bd84
1 changed files with 12 additions and 0 deletions
|
@ -180,6 +180,16 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text))
|
postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text))
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
|
|
||||||
|
postfix_snippet(
|
||||||
|
ctx,
|
||||||
|
cap,
|
||||||
|
&dot_receiver,
|
||||||
|
"some",
|
||||||
|
"Some(expr)",
|
||||||
|
&format!("Some({})", receiver_text),
|
||||||
|
)
|
||||||
|
.add_to(acc);
|
||||||
|
|
||||||
postfix_snippet(
|
postfix_snippet(
|
||||||
ctx,
|
ctx,
|
||||||
cap,
|
cap,
|
||||||
|
@ -291,6 +301,7 @@ fn main() {
|
||||||
sn ok Ok(expr)
|
sn ok Ok(expr)
|
||||||
sn ref &expr
|
sn ref &expr
|
||||||
sn refm &mut expr
|
sn refm &mut expr
|
||||||
|
sn some Some(expr)
|
||||||
sn while while expr {}
|
sn while while expr {}
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
@ -314,6 +325,7 @@ fn main() {
|
||||||
sn ok Ok(expr)
|
sn ok Ok(expr)
|
||||||
sn ref &expr
|
sn ref &expr
|
||||||
sn refm &mut expr
|
sn refm &mut expr
|
||||||
|
sn some Some(expr)
|
||||||
"#]],
|
"#]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue