diff options
Diffstat (limited to 'support/texlab/src/workspace/api.rs')
-rw-r--r-- | support/texlab/src/workspace/api.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/support/texlab/src/workspace/api.rs b/support/texlab/src/workspace/api.rs index 1ccd19d4e4..6a3c3d02c9 100644 --- a/support/texlab/src/workspace/api.rs +++ b/support/texlab/src/workspace/api.rs @@ -1,6 +1,7 @@ use std::{fs, path::PathBuf, sync::Arc}; use anyhow::Result; +use notify::RecursiveMode; use crate::{DocumentLanguage, Uri}; @@ -37,9 +38,9 @@ pub trait Workspace: Send + Sync { return Ok(self.get(&uri)); } - let data = fs::read(&path)?; - let text = String::from_utf8_lossy(&data).into_owned(); if let Some(language) = DocumentLanguage::by_path(&path) { + let data = fs::read(&path)?; + let text = String::from_utf8_lossy(&data).into_owned(); Ok(Some(self.open( uri, text, @@ -83,4 +84,6 @@ pub trait Workspace: Send + Sync { fn is_open(&self, uri: &Uri) -> bool; fn subset(&self, uri: Arc<Uri>) -> Option<WorkspaceSubset>; + + fn watch(&self, path: PathBuf, mode: RecursiveMode) -> Result<()>; } |