aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/world.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/world.rs')
-rw-r--r--crates/ra_lsp_server/src/world.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs
index 7a3030a51..e7a0acfc7 100644
--- a/crates/ra_lsp_server/src/world.rs
+++ b/crates/ra_lsp_server/src/world.rs
@@ -62,9 +62,9 @@ pub struct WorldSnapshot {
62 pub options: Options, 62 pub options: Options,
63 pub workspaces: Arc<Vec<ProjectWorkspace>>, 63 pub workspaces: Arc<Vec<ProjectWorkspace>>,
64 pub analysis: Analysis, 64 pub analysis: Analysis,
65 pub vfs: Arc<RwLock<Vfs>>,
66 pub latest_requests: Arc<RwLock<LatestRequests>>, 65 pub latest_requests: Arc<RwLock<LatestRequests>>,
67 pub check_watcher: Arc<RwLock<CheckState>>, 66 pub check_watcher: Arc<RwLock<CheckState>>,
67 vfs: Arc<RwLock<Vfs>>,
68} 68}
69 69
70impl WorldState { 70impl WorldState {
@@ -265,6 +265,10 @@ impl WorldSnapshot {
265 Ok(url) 265 Ok(url)
266 } 266 }
267 267
268 pub fn file_id_to_path(&self, id: FileId) -> PathBuf {
269 self.vfs.read().file2path(VfsFile(id.0))
270 }
271
268 pub fn file_line_endings(&self, id: FileId) -> LineEndings { 272 pub fn file_line_endings(&self, id: FileId) -> LineEndings {
269 self.vfs.read().file_line_endings(VfsFile(id.0)) 273 self.vfs.read().file_line_endings(VfsFile(id.0))
270 } 274 }