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",
|
||||
target,
|
||||
|builder| {
|
||||
builder.replace(
|
||||
statement.syntax().text_range(),
|
||||
builder.insert(
|
||||
statement.syntax().text_range.start(),
|
||||
format!(
|
||||
"const {}: {} = $0;\n{}{}",
|
||||
"const {}: {} = $0;\n{}",
|
||||
constant_token,
|
||||
type_name,
|
||||
indent,
|
||||
statement_syntax.text()
|
||||
indent
|
||||
),
|
||||
);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user