diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index a838c30da75..c2ef61ae225 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -37,6 +37,7 @@ mod line_index; mod folding_ranges; mod line_index_utils; mod join_lines; +mod typing; #[cfg(test)] mod marks; @@ -295,7 +296,7 @@ impl Analysis { /// up minor stuff like continuing the comment. pub fn on_enter(&self, position: FilePosition) -> Option { let file = self.db.parse(position.file_id); - let edit = ra_ide_api_light::on_enter(&file, position.offset)?; + let edit = typing::on_enter(&file, position.offset)?; Some(SourceChange::from_local_edit(position.file_id, edit)) } @@ -304,14 +305,14 @@ impl Analysis { // FIXME: use a snippet completion instead of this hack here. pub fn on_eq_typed(&self, position: FilePosition) -> Option { let file = self.db.parse(position.file_id); - let edit = ra_ide_api_light::on_eq_typed(&file, position.offset)?; + let edit = typing::on_eq_typed(&file, position.offset)?; Some(SourceChange::from_local_edit(position.file_id, edit)) } /// Returns an edit which should be applied when a dot ('.') is typed on a blank line, indenting the line appropriately. pub fn on_dot_typed(&self, position: FilePosition) -> Option { let file = self.db.parse(position.file_id); - let edit = ra_ide_api_light::on_dot_typed(&file, position.offset)?; + let edit = typing::on_dot_typed(&file, position.offset)?; Some(SourceChange::from_local_edit(position.file_id, edit)) } diff --git a/crates/ra_ide_api_light/src/typing.rs b/crates/ra_ide_api/src/typing.rs similarity index 99% rename from crates/ra_ide_api_light/src/typing.rs rename to crates/ra_ide_api/src/typing.rs index c69270333c7..b7e023d60d6 100644 --- a/crates/ra_ide_api_light/src/typing.rs +++ b/crates/ra_ide_api/src/typing.rs @@ -5,7 +5,8 @@ use ra_syntax::{ ast::{self, AstToken}, }; use ra_fmt::leading_indent; -use crate::{LocalEdit, TextEditBuilder}; +use crate::LocalEdit; +use ra_text_edit::TextEditBuilder; pub fn on_enter(file: &SourceFile, offset: TextUnit) -> Option { let comment = diff --git a/crates/ra_ide_api_light/src/lib.rs b/crates/ra_ide_api_light/src/lib.rs index f21a91e185c..0d928745f47 100644 --- a/crates/ra_ide_api_light/src/lib.rs +++ b/crates/ra_ide_api_light/src/lib.rs @@ -4,10 +4,8 @@ //! an edit or some auxiliary info. mod structure; -mod typing; use rustc_hash::FxHashSet; -use ra_text_edit::TextEditBuilder; use ra_syntax::{ SourceFile, SyntaxNode, TextRange, TextUnit, Direction, algo::find_leaf_at_offset, @@ -17,7 +15,6 @@ use ra_syntax::{ pub use crate::{ structure::{file_structure, StructureNode}, - typing::{on_enter, on_dot_typed, on_eq_typed}, }; #[derive(Debug)]