diff --git a/lsp/src/main.rs b/lsp/src/main.rs index 0fa0cb4..e103a5c 100644 --- a/lsp/src/main.rs +++ b/lsp/src/main.rs @@ -17,6 +17,7 @@ * along with this program. If not, see */ +use std::ffi::OsStr; use std::fmt::Debug; use std::path::{Path, PathBuf}; use std::sync::{Mutex, MutexGuard}; @@ -59,6 +60,15 @@ impl Document { fn get_filename(&self) -> &str { return self.path.file_name().unwrap().to_str().unwrap(); } + + fn get_extension(&self) -> &str { + return self + .path + .extension() + .unwrap_or(OsStr::new("")) + .to_str() + .unwrap(); + } } impl Backend {