mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Collect field data for structs/enum variants
This commit is contained in:
parent
4cb7b0f2af
commit
07a7285965
5 changed files with 87 additions and 12 deletions
|
@ -135,6 +135,12 @@ impl DefId {
|
|||
};
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
/// For a module, returns that module; for any other def, returns the containing module.
|
||||
pub fn module(self, db: &impl HirDatabase) -> Cancelable<Module> {
|
||||
let loc = self.loc(db);
|
||||
Module::new(db, loc.source_root_id, loc.module_id)
|
||||
}
|
||||
}
|
||||
|
||||
/// Identifier of item within a specific file. This is stable over reparses, so
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue