summaryrefslogtreecommitdiff
path: root/test_util/src/temp_dir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test_util/src/temp_dir.rs')
-rw-r--r--test_util/src/temp_dir.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/test_util/src/temp_dir.rs b/test_util/src/temp_dir.rs
index 01dce8f1a..b800e425d 100644
--- a/test_util/src/temp_dir.rs
+++ b/test_util/src/temp_dir.rs
@@ -9,6 +9,7 @@ use std::sync::Arc;
use std::time::SystemTime;
use anyhow::Context;
+use lsp_types::Url;
use once_cell::sync::OnceCell;
static TEMP_DIR_SESSION: OnceCell<TempDirSession> = OnceCell::new();
@@ -83,6 +84,10 @@ impl TempDir {
})
}
+ pub fn uri(&self) -> Url {
+ Url::from_directory_path(self.path()).unwrap()
+ }
+
pub fn path(&self) -> &Path {
let inner = &self.0;
inner.0.as_path()