@@ -18,7 +18,7 @@ pub use crate::{
1818 } ,
1919} ;
2020pub use salsa;
21- pub use vfs:: { file_set:: FileSet , FileId , VfsPath } ;
21+ pub use vfs:: { file_set:: FileSet , AnchoredPath , AnchoredPathBuf , FileId , VfsPath } ;
2222
2323#[ macro_export]
2424macro_rules! impl_intern_key {
@@ -91,12 +91,7 @@ pub const DEFAULT_LRU_CAP: usize = 128;
9191pub trait FileLoader {
9292 /// Text of the file.
9393 fn file_text ( & self , file_id : FileId ) -> Arc < String > ;
94- /// Note that we intentionally accept a `&str` and not a `&Path` here. This
95- /// method exists to handle `#[path = "/some/path.rs"] mod foo;` and such,
96- /// so the input is guaranteed to be utf-8 string. One might be tempted to
97- /// introduce some kind of "utf-8 path with / separators", but that's a bad idea. Behold
98- /// `#[path = "C://no/way"]`
99- fn resolve_path ( & self , anchor : FileId , path : & str ) -> Option < FileId > ;
94+ fn resolve_path ( & self , path : AnchoredPath ) -> Option < FileId > ;
10095 fn relevant_crates ( & self , file_id : FileId ) -> Arc < FxHashSet < CrateId > > ;
10196}
10297
@@ -155,11 +150,11 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> {
155150 fn file_text ( & self , file_id : FileId ) -> Arc < String > {
156151 SourceDatabaseExt :: file_text ( self . 0 , file_id)
157152 }
158- fn resolve_path ( & self , anchor : FileId , path : & str ) -> Option < FileId > {
153+ fn resolve_path ( & self , path : AnchoredPath ) -> Option < FileId > {
159154 // FIXME: this *somehow* should be platform agnostic...
160- let source_root = self . 0 . file_source_root ( anchor) ;
155+ let source_root = self . 0 . file_source_root ( path . anchor ) ;
161156 let source_root = self . 0 . source_root ( source_root) ;
162- source_root. file_set . resolve_path ( anchor , path)
157+ source_root. file_set . resolve_path ( path)
163158 }
164159
165160 fn relevant_crates ( & self , file_id : FileId ) -> Arc < FxHashSet < CrateId > > {
0 commit comments