mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
hack around nested libraries
This commit is contained in:
parent
8a572043e7
commit
6b1f30ade9
4 changed files with 44 additions and 3 deletions
|
@ -59,6 +59,9 @@ impl FileResolverImp {
|
|||
pub(crate) fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> {
|
||||
self.inner.resolve(file_id, path)
|
||||
}
|
||||
pub(crate) fn debug_path(&self, file_id: FileId) -> Option<std::path::PathBuf> {
|
||||
self.inner.debug_path(file_id)
|
||||
}
|
||||
fn inner(&self) -> *const FileResolver {
|
||||
&*self.inner
|
||||
}
|
||||
|
@ -138,6 +141,11 @@ impl AnalysisHostImpl {
|
|||
let mut files = FxHashSet::default();
|
||||
for (file_id, text) in library.files {
|
||||
files.insert(file_id);
|
||||
log::debug!(
|
||||
"library file: {:?} {:?}",
|
||||
file_id,
|
||||
library.file_resolver.debug_path(file_id)
|
||||
);
|
||||
self.db
|
||||
.query_mut(crate::input::FileSourceRootQuery)
|
||||
.set_constant(file_id, source_root_id);
|
||||
|
|
|
@ -33,6 +33,9 @@ impl CrateGraph {
|
|||
pub trait FileResolver: fmt::Debug + Send + Sync + 'static {
|
||||
fn file_stem(&self, file_id: FileId) -> String;
|
||||
fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId>;
|
||||
fn debug_path(&self, _file_id: FileId) -> Option<std::path::PathBuf> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
salsa::query_group! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue