diff options
Diffstat (limited to 'support/texlab/src/environment.rs')
-rw-r--r-- | support/texlab/src/environment.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/support/texlab/src/environment.rs b/support/texlab/src/environment.rs new file mode 100644 index 0000000000..5ba80617d5 --- /dev/null +++ b/support/texlab/src/environment.rs @@ -0,0 +1,32 @@ +use std::{path::PathBuf, sync::Arc}; + +use lsp_types::{ClientCapabilities, ClientInfo}; + +use crate::{distro::Resolver, Options}; + +#[derive(Debug, Clone)] +pub struct Environment { + pub current_directory: Arc<PathBuf>, + pub client_capabilities: Arc<ClientCapabilities>, + pub client_info: Option<Arc<ClientInfo>>, + pub options: Arc<Options>, + pub resolver: Arc<Resolver>, +} + +impl Environment { + pub fn new(current_directory: Arc<PathBuf>) -> Self { + Self { + current_directory, + client_capabilities: Arc::new(ClientCapabilities::default()), + client_info: None, + options: Arc::new(Options::default()), + resolver: Arc::new(Resolver::default()), + } + } +} + +impl Default for Environment { + fn default() -> Self { + Self::new(Arc::new(std::env::temp_dir())) + } +} |