mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
add_missing_impl_members no longer breaks indentation
This commit is contained in:
parent
a0db4781dc
commit
e07d6382de
3 changed files with 106 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ use stdx::format_to;
|
|||
use syntax::{
|
||||
ast::{
|
||||
self,
|
||||
edit::{self, AstNodeEdit},
|
||||
edit::{AstNodeEdit, IndentLevel},
|
||||
edit_in_place::{AttrsOwnerEdit, Removable},
|
||||
make, HasArgList, HasAttrs, HasGenericParams, HasName, HasTypeBounds, Whitespace,
|
||||
},
|
||||
|
|
@ -154,7 +154,7 @@ pub fn add_trait_assoc_items_to_impl(
|
|||
match &item {
|
||||
ast::AssocItem::Fn(fn_) if fn_.body().is_none() => {
|
||||
let body = make::block_expr(None, Some(make::ext::expr_todo()))
|
||||
.indent(edit::IndentLevel(1));
|
||||
.indent(IndentLevel::from_node(impl_.syntax()) + 1);
|
||||
ted::replace(fn_.get_or_create_body().syntax(), body.clone_for_update().syntax())
|
||||
}
|
||||
ast::AssocItem::TypeAlias(type_alias) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue