diff options
Diffstat (limited to 'crates/server/src/path_map.rs')
-rw-r--r-- | crates/server/src/path_map.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/server/src/path_map.rs b/crates/server/src/path_map.rs index 2454ba05f..e198e165d 100644 --- a/crates/server/src/path_map.rs +++ b/crates/server/src/path_map.rs | |||
@@ -34,6 +34,11 @@ impl PathMap { | |||
34 | .as_path() | 34 | .as_path() |
35 | } | 35 | } |
36 | 36 | ||
37 | pub fn resolve(&self, id: FileId, relpath: &Path) -> Option<FileId> { | ||
38 | let path = self.get_path(id).join(relpath); | ||
39 | self.get_id(&path) | ||
40 | } | ||
41 | |||
37 | fn insert(&mut self, path: PathBuf, id: FileId) { | 42 | fn insert(&mut self, path: PathBuf, id: FileId) { |
38 | self.path2id.insert(path.clone(), id); | 43 | self.path2id.insert(path.clone(), id); |
39 | self.id2path.insert(id, path.clone()); | 44 | self.id2path.insert(id, path.clone()); |