aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-13 11:00:05 +0100
committerGitHub <[email protected]>2020-08-13 11:00:05 +0100
commit8870a5ea138bb4ba048140d90d728721c4b4ad4b (patch)
treee355901a2d197f2b7cceb35a732a111afed58198 /crates/ra_ide
parentb5cb16fb90b4a1076604c5795552ee4abe07a057 (diff)
parentc81f6230da98fd3e3fa91c0896d65922a1ed4a24 (diff)
Merge #5743
5743: Remove ra_fmt crate r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/Cargo.toml1
-rw-r--r--crates/ra_ide/src/typing.rs5
2 files changed, 2 insertions, 4 deletions
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" }
26ra_db = { path = "../ra_db" } 26ra_db = { path = "../ra_db" }
27ra_ide_db = { path = "../ra_ide_db" } 27ra_ide_db = { path = "../ra_ide_db" }
28cfg = { path = "../cfg" } 28cfg = { path = "../cfg" }
29ra_fmt = { path = "../ra_fmt" }
30profile = { path = "../profile" } 29profile = { path = "../profile" }
31test_utils = { path = "../test_utils" } 30test_utils = { path = "../test_utils" }
32ra_assists = { path = "../ra_assists" } 31ra_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 @@
16mod on_enter; 16mod on_enter;
17 17
18use ra_db::{FilePosition, SourceDatabase}; 18use ra_db::{FilePosition, SourceDatabase};
19use ra_fmt::leading_indent;
20use ra_ide_db::{source_change::SourceFileEdit, RootDatabase}; 19use ra_ide_db::{source_change::SourceFileEdit, RootDatabase};
21use syntax::{ 20use syntax::{
22 algo::find_node_at_offset, 21 algo::find_node_at_offset,
23 ast::{self, AstToken}, 22 ast::{self, edit::IndentLevel, AstToken},
24 AstNode, SourceFile, 23 AstNode, SourceFile,
25 SyntaxKind::{FIELD_EXPR, METHOD_CALL_EXPR}, 24 SyntaxKind::{FIELD_EXPR, METHOD_CALL_EXPR},
26 TextRange, TextSize, 25 TextRange, TextSize,
@@ -104,7 +103,7 @@ fn on_dot_typed(file: &SourceFile, offset: TextSize) -> Option<TextEdit> {
104 if !matches!(parent.kind(), FIELD_EXPR | METHOD_CALL_EXPR) { 103 if !matches!(parent.kind(), FIELD_EXPR | METHOD_CALL_EXPR) {
105 return None; 104 return None;
106 } 105 }
107 let prev_indent = leading_indent(&parent)?; 106 let prev_indent = IndentLevel::from_node(&parent);
108 let target_indent = format!(" {}", prev_indent); 107 let target_indent = format!(" {}", prev_indent);
109 let target_indent_len = TextSize::of(&target_indent); 108 let target_indent_len = TextSize::of(&target_indent);
110 if current_indent_len == target_indent_len { 109 if current_indent_len == target_indent_len {