From c81f6230da98fd3e3fa91c0896d65922a1ed4a24 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 11:56:11 +0200 Subject: Remove ra_fmt crate --- crates/ra_ide/Cargo.toml | 1 - crates/ra_ide/src/typing.rs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml index c60e55545..938398a41 100644 --- a/crates/ra_ide/Cargo.toml +++ b/crates/ra_ide/Cargo.toml @@ -26,7 +26,6 @@ text_edit = { path = "../text_edit" } ra_db = { path = "../ra_db" } ra_ide_db = { path = "../ra_ide_db" } cfg = { path = "../cfg" } -ra_fmt = { path = "../ra_fmt" } profile = { path = "../profile" } test_utils = { path = "../test_utils" } ra_assists = { path = "../ra_assists" } diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs index c408b1d52..7897c57b7 100644 --- a/crates/ra_ide/src/typing.rs +++ b/crates/ra_ide/src/typing.rs @@ -16,11 +16,10 @@ mod on_enter; use ra_db::{FilePosition, SourceDatabase}; -use ra_fmt::leading_indent; use ra_ide_db::{source_change::SourceFileEdit, RootDatabase}; use syntax::{ algo::find_node_at_offset, - ast::{self, AstToken}, + ast::{self, edit::IndentLevel, AstToken}, AstNode, SourceFile, SyntaxKind::{FIELD_EXPR, METHOD_CALL_EXPR}, TextRange, TextSize, @@ -104,7 +103,7 @@ fn on_dot_typed(file: &SourceFile, offset: TextSize) -> Option { if !matches!(parent.kind(), FIELD_EXPR | METHOD_CALL_EXPR) { return None; } - let prev_indent = leading_indent(&parent)?; + let prev_indent = IndentLevel::from_node(&parent); let target_indent = format!(" {}", prev_indent); let target_indent_len = TextSize::of(&target_indent); if current_indent_len == target_indent_len { -- cgit v1.2.3