mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Resolve 2015 style imports
This commit is contained in:
parent
3a9934e2c3
commit
d5ad38cbb8
4 changed files with 119 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use relative_path::RelativePathBuf;
|
||||
use ra_db::{CrateId, FileId, SourceRootId};
|
||||
use ra_db::{CrateId, FileId, SourceRootId, Edition};
|
||||
use ra_syntax::{ast::self, TreeArc, SyntaxNode};
|
||||
|
||||
use crate::{
|
||||
|
@ -38,13 +38,20 @@ impl Crate {
|
|||
pub fn crate_id(&self) -> CrateId {
|
||||
self.crate_id
|
||||
}
|
||||
|
||||
pub fn dependencies(&self, db: &impl PersistentHirDatabase) -> Vec<CrateDependency> {
|
||||
self.dependencies_impl(db)
|
||||
}
|
||||
|
||||
pub fn root_module(&self, db: &impl PersistentHirDatabase) -> Option<Module> {
|
||||
self.root_module_impl(db)
|
||||
}
|
||||
|
||||
pub fn edition(&self, db: &impl PersistentHirDatabase) -> Edition {
|
||||
let crate_graph = db.crate_graph();
|
||||
crate_graph.edition(self.crate_id)
|
||||
}
|
||||
|
||||
// TODO: should this be in source_binder?
|
||||
pub fn source_root_crates(
|
||||
db: &impl PersistentHirDatabase,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue