summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-08-02 16:57:25 -0400
committerGitHub <noreply@github.com>2023-08-02 16:57:25 -0400
commit480894e5c8f9532a4c42477cdf5c058cb8e9e1e3 (patch)
tree7241c8864439b60c97f2140ccdef17ed07a5dbcf /test_util/src
parente8d03119a0599ef8d811f8fa33ad1a580adf5511 (diff)
feat(unstable/lsp): support navigating to deno_modules folder (#20030)
Closes #20015 Closes https://github.com/denoland/vscode_deno/issues/850 (only for deno_modules, but I don't think this will be possible for the global cache)
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/fs.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/test_util/src/fs.rs b/test_util/src/fs.rs
index 57ab8ee10..b2f0eceac 100644
--- a/test_util/src/fs.rs
+++ b/test_util/src/fs.rs
@@ -47,10 +47,14 @@ impl PathRef {
PathRef(self.as_path().parent().unwrap().to_path_buf())
}
- pub fn uri(&self) -> Url {
+ pub fn uri_dir(&self) -> Url {
Url::from_directory_path(self.as_path()).unwrap()
}
+ pub fn uri_file(&self) -> Url {
+ Url::from_file_path(self.as_path()).unwrap()
+ }
+
pub fn as_path(&self) -> &Path {
self.0.as_path()
}