Resolve crate
This commit is contained in:
parent
3c17643b30
commit
04eb15856b
2 changed files with 2 additions and 3 deletions
|
@ -24,7 +24,7 @@ use crate::{
|
|||
/// root module.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct Crate {
|
||||
pub crate_id: CrateId,
|
||||
pub(crate) crate_id: CrateId,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -14,9 +14,8 @@ pub(crate) fn goto_implementation(
|
|||
let file = db.parse(position.file_id);
|
||||
let syntax = file.syntax();
|
||||
|
||||
let krate_id = db.crate_for(position.file_id).pop()?;
|
||||
let krate = hir::Crate { crate_id: krate_id };
|
||||
let module = source_binder::module_from_position(db, position)?;
|
||||
let krate = module.krate(db)?;
|
||||
|
||||
let node = find_node_at_offset::<ast::NominalDef>(syntax, position.offset)?;
|
||||
let ty = match node.kind() {
|
||||
|
|
Loading…
Add table
Reference in a new issue