mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
fix syntax errors in tests
This commit is contained in:
parent
2e3f5af9d4
commit
c8bcfe6a05
7 changed files with 137 additions and 121 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue