fix syntax errors in tests

This commit is contained in:
Aleksey Kladov 2019-05-28 18:07:39 +03:00
parent 2e3f5af9d4
commit c8bcfe6a05
7 changed files with 137 additions and 121 deletions

View file

@ -46,7 +46,7 @@ pub fn module_from_declaration(
/// Locates the module by position in the source code.
pub fn module_from_position(db: &impl HirDatabase, position: FilePosition) -> Option<Module> {
let file = db.parse(position.file_id);
let file = db.parse(position.file_id).tree;
match find_node_at_offset::<ast::Module>(file.syntax(), position.offset) {
Some(m) if !m.has_semi() => module_from_inline(db, position.file_id.into(), m),
_ => module_from_file_id(db, position.file_id.into()),