mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 13:23:25 +00:00
internal: port rust-analyzer to new Salsa
This commit is contained in:
parent
394374e769
commit
74620e64ec
161 changed files with 3075 additions and 2331 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! This module resolves `mod foo;` declaration to file.
|
||||
use arrayvec::ArrayVec;
|
||||
use base_db::AnchoredPath;
|
||||
use base_db::{AnchoredPath, RootQueryDb};
|
||||
use hir_expand::{name::Name, HirFileIdExt};
|
||||
use span::EditionedFileId;
|
||||
|
||||
|
|
@ -80,7 +80,8 @@ impl ModDir {
|
|||
let orig_file_id = file_id.original_file_respecting_includes(db.upcast());
|
||||
for candidate in candidate_files.iter() {
|
||||
let path = AnchoredPath { anchor: orig_file_id.file_id(), path: candidate.as_str() };
|
||||
if let Some(file_id) = db.resolve_path(path) {
|
||||
if let Some(file_id) = base_db::Upcast::<dyn RootQueryDb>::upcast(db).resolve_path(path)
|
||||
{
|
||||
let is_mod_rs = candidate.ends_with("/mod.rs");
|
||||
|
||||
let root_dir_owner = is_mod_rs || attr_path.is_some();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue