Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/typing/on_enter.rs')
| -rw-r--r-- | crates/ide/src/typing/on_enter.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/ide/src/typing/on_enter.rs b/crates/ide/src/typing/on_enter.rs index c6d1c283f4..fdc583a15c 100644 --- a/crates/ide/src/typing/on_enter.rs +++ b/crates/ide/src/typing/on_enter.rs @@ -1,15 +1,14 @@ //! Handles the `Enter` key press. At the momently, this only continues //! comments, but should handle indent some time in the future as well. -use ide_db::RootDatabase; -use ide_db::{base_db::SourceDatabase, FilePosition}; -use span::EditionedFileId; +use ide_db::base_db::RootQueryDb; +use ide_db::{FilePosition, RootDatabase}; use syntax::{ - algo::find_node_at_offset, - ast::{self, edit::IndentLevel, AstToken}, AstNode, SmolStr, SourceFile, SyntaxKind::*, SyntaxNode, SyntaxToken, TextRange, TextSize, TokenAtOffset, + algo::find_node_at_offset, + ast::{self, AstToken, edit::IndentLevel}, }; use ide_db::text_edit::TextEdit; @@ -51,7 +50,9 @@ use ide_db::text_edit::TextEdit; // //  pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<TextEdit> { - let parse = db.parse(EditionedFileId::current_edition(position.file_id)); + let editioned_file_id_wrapper = + ide_db::base_db::EditionedFileId::current_edition(db, position.file_id); + let parse = db.parse(editioned_file_id_wrapper); let file = parse.tree(); let token = file.syntax().token_at_offset(position.offset).left_biased()?; |