Insert snippet positions after fields names in record patterns
This commit is contained in:
parent
33ecad4407
commit
2cd2947bf8
@ -156,7 +156,7 @@ fn foo() {
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
bn Bar Bar { ${1:f} }$0
|
||||
bn Bar Bar { f$1 }$0
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
@ -171,7 +171,7 @@ struct Foo { bar: String, baz: String }
|
||||
fn outer(<|>) {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
bn Foo Foo { ${1:bar}, ${2:baz} }: Foo$0
|
||||
bn Foo Foo { bar$1, baz$2 }: Foo$0
|
||||
bn Bar Bar($1, $2): Bar$0
|
||||
"#]],
|
||||
)
|
||||
@ -189,7 +189,7 @@ fn outer() {
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
bn Foo Foo { ${1:bar}, ${2:baz} }$0
|
||||
bn Foo Foo { bar$1, baz$2 }$0
|
||||
bn Bar Bar($1, $2)$0
|
||||
"#]],
|
||||
)
|
||||
@ -209,7 +209,7 @@ fn outer() {
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
bn Foo Foo { ${1:bar}, ${2:baz} }$0
|
||||
bn Foo Foo { bar$1, baz$2 }$0
|
||||
bn Bar Bar($1, $2)$0
|
||||
"#]],
|
||||
)
|
||||
@ -233,7 +233,7 @@ fn outer() {
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
bn Foo Foo { ${1:bar}, .. }$0
|
||||
bn Foo Foo { bar$1, .. }$0
|
||||
bn Bar Bar($1, ..)$0
|
||||
"#]],
|
||||
)
|
||||
|
@ -121,7 +121,7 @@ fn render_record_as_pat(
|
||||
"{name} {{ {}{} }}",
|
||||
fields
|
||||
.enumerate()
|
||||
.map(|(idx, field)| format!("${{{}:{}}}", idx + 1, field.name(db)))
|
||||
.map(|(idx, field)| format!("{}${}", field.name(db), idx + 1))
|
||||
.format(", "),
|
||||
if fields_omitted { ", .." } else { "" },
|
||||
name = name
|
||||
|
Loading…
Reference in New Issue
Block a user