diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs index 0f29149507..66b296081d 100644 --- a/crates/ra_assists/src/handlers/early_return.rs +++ b/crates/ra_assists/src/handlers/early_return.rs @@ -156,7 +156,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext) parent_block: &ast::BlockExpr, if_expr: &ast::IfExpr, ) -> SyntaxNode { - let then_block_items = then_block.unindent(IndentLevel::from(1)); + let then_block_items = then_block.dedent(IndentLevel::from(1)); let end_of_then = then_block_items.syntax().last_child_or_token().unwrap(); let end_of_then = if end_of_then.prev_sibling_or_token().map(|n| n.kind()) == Some(WHITESPACE) { diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 94dfb1a139..24a1e1d918 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs @@ -555,7 +555,7 @@ pub trait AstNodeEdit: AstNode + Clone + Sized { Self::cast(indent.increase_indent(self.syntax().clone())).unwrap() } #[must_use] - fn unindent(&self, indent: IndentLevel) -> Self { + fn dedent(&self, indent: IndentLevel) -> Self { Self::cast(indent.decrease_indent(self.syntax().clone())).unwrap() } } diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index b13e13af2a..b1e3c328f3 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -270,7 +270,7 @@ fn parse_fixture_checks_further_indented_metadata() { } #[test] -fn parse_fixture_can_handle_unindented_first_line() { +fn parse_fixture_can_handle_dedented_first_line() { let fixture = "//- /lib.rs mod foo; //- /foo.rs