mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Introduce anchored_path
They allow to represent paths like `#[path = "C:\path.rs"] mod foo;` in a lossless cross-platform & network-transparent way.
This commit is contained in:
parent
5e3891c255
commit
6e24321e45
13 changed files with 79 additions and 65 deletions
|
@ -19,8 +19,8 @@ use std::{fmt, sync::Arc};
|
|||
|
||||
use base_db::{
|
||||
salsa::{self, Durability},
|
||||
Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase,
|
||||
Upcast,
|
||||
AnchoredPath, Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate,
|
||||
SourceDatabase, Upcast,
|
||||
};
|
||||
use hir::db::{AstDatabase, DefDatabase, HirDatabase};
|
||||
use rustc_hash::FxHashSet;
|
||||
|
@ -72,8 +72,8 @@ impl FileLoader for RootDatabase {
|
|||
fn file_text(&self, file_id: FileId) -> Arc<String> {
|
||||
FileLoaderDelegate(self).file_text(file_id)
|
||||
}
|
||||
fn resolve_path(&self, anchor: FileId, path: &str) -> Option<FileId> {
|
||||
FileLoaderDelegate(self).resolve_path(anchor, path)
|
||||
fn resolve_path(&self, path: AnchoredPath) -> Option<FileId> {
|
||||
FileLoaderDelegate(self).resolve_path(path)
|
||||
}
|
||||
fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>> {
|
||||
FileLoaderDelegate(self).relevant_crates(file_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue