mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Use Crate instead of CrateId
This commit is contained in:
parent
95aa7e46fc
commit
ef7eb8c257
9 changed files with 36 additions and 45 deletions
|
@ -14,7 +14,7 @@ use ra_syntax::{
|
|||
|
||||
use crate::{
|
||||
HirDatabase, Function, ModuleDef, Struct, Enum,
|
||||
AsName, Module, HirFileId,
|
||||
AsName, Module, HirFileId, Crate,
|
||||
ids::{LocationCtx, SourceFileItemId},
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,8 @@ fn module_from_source(
|
|||
let source_root_id = db.file_source_root(file_id.as_original_file());
|
||||
db.source_root_crates(source_root_id)
|
||||
.iter()
|
||||
.find_map(|&krate| {
|
||||
.map(|&crate_id| Crate { crate_id })
|
||||
.find_map(|krate| {
|
||||
let module_tree = db.module_tree(krate);
|
||||
let module_id = module_tree.find_module_by_source(file_id, decl_id)?;
|
||||
Some(Module { krate, module_id })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue