mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
make Parse fields private
this is in preparation for the new rowan API
This commit is contained in:
parent
2e466bb365
commit
deab4caa7b
31 changed files with 109 additions and 99 deletions
|
@ -49,8 +49,8 @@ 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).tree;
|
||||
match find_node_at_offset::<ast::Module>(file.syntax(), position.offset) {
|
||||
let parse = db.parse(position.file_id);
|
||||
match find_node_at_offset::<ast::Module>(parse.tree().syntax(), position.offset) {
|
||||
Some(m) if !m.has_semi() => module_from_inline(db, position.file_id, m),
|
||||
_ => module_from_file_id(db, position.file_id),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue