aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/server_world.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/server_world.rs')
-rw-r--r--crates/ra_lsp_server/src/server_world.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs
index 45ad8e24e..b2808b817 100644
--- a/crates/ra_lsp_server/src/server_world.rs
+++ b/crates/ra_lsp_server/src/server_world.rs
@@ -1,5 +1,5 @@
1use std::{ 1use std::{
2 path::PathBuf, 2 path::{Path, PathBuf},
3 sync::Arc, 3 sync::Arc,
4}; 4};
5 5
@@ -195,4 +195,9 @@ impl ServerWorld {
195 res.push_str(&self.analysis.status()); 195 res.push_str(&self.analysis.status());
196 res 196 res
197 } 197 }
198
199 pub fn workspace_root_for(&self, file_id: FileId) -> Option<&Path> {
200 let path = self.vfs.read().file2path(VfsFile(file_id.0.into()));
201 self.workspaces.iter().find_map(|ws| ws.workspace_root_for(&path))
202 }
198} 203}