Skip to content

Commit 7768602

Browse files
committed
Improve let snippet
1 parent 1327f70 commit 7768602

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ pub(crate) fn complete_expr_path(
369369
}
370370

371371
if in_block_expr {
372-
add_keyword("letm", "let mut $1 = $2;");
373-
add_keyword("let", "let $1 = $2;");
372+
add_keyword("letm", "let mut $1 = $0;");
373+
add_keyword("let", "let $1 = $0;");
374374
}
375375

376376
if after_if_expr {

src/tools/rust-analyzer/crates/ide-completion/src/completions/keyword.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ fn main() {
346346
"#,
347347
r#"
348348
fn main() {
349-
let $1 = $2;
349+
let $1 = $0;
350350
}
351351
"#,
352352
);
@@ -359,7 +359,7 @@ fn main() {
359359
"#,
360360
r#"
361361
fn main() {
362-
let mut $1 = $2;
362+
let mut $1 = $0;
363363
}
364364
"#,
365365
);
@@ -436,7 +436,7 @@ fn main() {
436436
"#,
437437
r#"
438438
fn main() {
439-
if { let $1 = $2; } {}
439+
if { let $1 = $0; } {}
440440
}
441441
"#,
442442
);
@@ -449,7 +449,7 @@ fn main() {
449449
"#,
450450
r#"
451451
fn main() {
452-
if { let mut $1 = $2; } {}
452+
if { let mut $1 = $0; } {}
453453
}
454454
"#,
455455
);

0 commit comments

Comments
 (0)