Update crates/ide_assists/src/handlers/generate_constant.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
fab238adf6
commit
7228dbadca
@ -57,14 +57,13 @@ pub(crate) fn generate_constant(acc: &mut Assists, ctx: &AssistContext) -> Optio
|
|||||||
"Generate constant",
|
"Generate constant",
|
||||||
target,
|
target,
|
||||||
|builder| {
|
|builder| {
|
||||||
builder.replace(
|
builder.insert(
|
||||||
statement.syntax().text_range(),
|
statement.syntax().text_range.start(),
|
||||||
format!(
|
format!(
|
||||||
"const {}: {} = $0;\n{}{}",
|
"const {}: {} = $0;\n{}",
|
||||||
constant_token,
|
constant_token,
|
||||||
type_name,
|
type_name,
|
||||||
indent,
|
indent
|
||||||
statement_syntax.text()
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user