diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-03-08 18:15:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 23:15:20 +0000 |
commit | 25d98ca289af64f85759fe10c8808afbfb7011e3 (patch) | |
tree | 79f0126791ae317b030696b7c507dee6420a660e /test_util/src/temp_dir.rs | |
parent | f2e5e01832a40eb71be82f1b46304c56aa2e8dba (diff) |
refactor(lsp): improve test client initialization (#18015)
Diffstat (limited to 'test_util/src/temp_dir.rs')
-rw-r--r-- | test_util/src/temp_dir.rs | 5 |
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() |