mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-03-12 20:00:31 +00:00
remove edit_in_place from move_const_to_impl assist with edit::AstNodeEdit
This commit is contained in:
parent
10746d7bab
commit
82f059b82b
@ -2,7 +2,7 @@ use hir::{AsAssocItem, AssocItemContainer, FileRange, HasSource};
|
||||
use ide_db::{assists::AssistId, defs::Definition, search::SearchScope};
|
||||
use syntax::{
|
||||
SyntaxKind,
|
||||
ast::{self, AstNode, edit::IndentLevel, edit_in_place::Indent},
|
||||
ast::{self, AstNode, edit::{AstNodeEdit, IndentLevel}},
|
||||
};
|
||||
|
||||
use crate::assist_context::{AssistContext, Assists};
|
||||
@ -136,7 +136,8 @@ pub(crate) fn move_const_to_impl(acc: &mut Assists, ctx: &AssistContext<'_>) ->
|
||||
let indent = IndentLevel::from_node(parent_fn.syntax());
|
||||
|
||||
let const_ = const_.clone_for_update();
|
||||
const_.reindent_to(indent);
|
||||
let const_ = const_.reset_indent();
|
||||
let const_ = const_.indent(indent);
|
||||
builder.insert(insert_offset, format!("\n{indent}{const_}{fixup}"));
|
||||
},
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user