diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/edit.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 29eb3fcb9..2ef173a03 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -579,12 +579,17 @@ pub trait AstNodeEdit: AstNode + Clone + Sized { | |||
579 | rewriter.rewrite_ast(self) | 579 | rewriter.rewrite_ast(self) |
580 | } | 580 | } |
581 | #[must_use] | 581 | #[must_use] |
582 | fn indent(&self, indent: IndentLevel) -> Self { | 582 | fn indent(&self, level: IndentLevel) -> Self { |
583 | Self::cast(indent.increase_indent(self.syntax().clone())).unwrap() | 583 | Self::cast(level.increase_indent(self.syntax().clone())).unwrap() |
584 | } | 584 | } |
585 | #[must_use] | 585 | #[must_use] |
586 | fn dedent(&self, indent: IndentLevel) -> Self { | 586 | fn dedent(&self, level: IndentLevel) -> Self { |
587 | Self::cast(indent.decrease_indent(self.syntax().clone())).unwrap() | 587 | Self::cast(level.decrease_indent(self.syntax().clone())).unwrap() |
588 | } | ||
589 | #[must_use] | ||
590 | fn reset_indent(&self) -> Self { | ||
591 | let level = IndentLevel::from_node(self.syntax()); | ||
592 | self.dedent(level) | ||
588 | } | 593 | } |
589 | } | 594 | } |
590 | 595 | ||