diff options
author | Aleksey Kladov <[email protected]> | 2020-06-05 13:55:23 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-05 13:58:30 +0100 |
commit | e63c00f100e960f7b72997026b4b2cd3cd29774b (patch) | |
tree | f789502d1e45282980e1eb8bfa1f5e96f45636b9 /crates/ra_db | |
parent | f98d057218ca30d052da2a119fa0b3108ba3a091 (diff) |
Rename resolve_relative_path -> resolve_path
For things like `concant!(env!("OUT_DIR"))`, we need to support abs paths
Diffstat (limited to 'crates/ra_db')
-rw-r--r-- | crates/ra_db/src/lib.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index fd4280de2..07e1b8aba 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -89,8 +89,7 @@ pub const DEFAULT_LRU_CAP: usize = 128; | |||
89 | pub trait FileLoader { | 89 | pub trait FileLoader { |
90 | /// Text of the file. | 90 | /// Text of the file. |
91 | fn file_text(&self, file_id: FileId) -> Arc<String>; | 91 | fn file_text(&self, file_id: FileId) -> Arc<String>; |
92 | fn resolve_relative_path(&self, anchor: FileId, relative_path: &RelativePath) | 92 | fn resolve_path(&self, anchor: FileId, relative_path: &RelativePath) -> Option<FileId>; |
93 | -> Option<FileId>; | ||
94 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>>; | 93 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>>; |
95 | 94 | ||
96 | fn resolve_extern_path( | 95 | fn resolve_extern_path( |
@@ -155,11 +154,7 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> { | |||
155 | fn file_text(&self, file_id: FileId) -> Arc<String> { | 154 | fn file_text(&self, file_id: FileId) -> Arc<String> { |
156 | SourceDatabaseExt::file_text(self.0, file_id) | 155 | SourceDatabaseExt::file_text(self.0, file_id) |
157 | } | 156 | } |
158 | fn resolve_relative_path( | 157 | fn resolve_path(&self, anchor: FileId, relative_path: &RelativePath) -> Option<FileId> { |
159 | &self, | ||
160 | anchor: FileId, | ||
161 | relative_path: &RelativePath, | ||
162 | ) -> Option<FileId> { | ||
163 | let path = { | 158 | let path = { |
164 | let mut path = self.0.file_relative_path(anchor); | 159 | let mut path = self.0.file_relative_path(anchor); |
165 | assert!(path.pop()); | 160 | assert!(path.pop()); |