summaryrefslogtreecommitdiff
path: root/cli/lsp/registries.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2021-07-28 07:25:09 +1000
committerGitHub <noreply@github.com>2021-07-28 07:25:09 +1000
commit667b026798b5284e9ec8bf47baba80f343975d2e (patch)
tree3e2d85160925222b7052645ffb5fa0c8a4aa476e /cli/lsp/registries.rs
parentfd0b24b246e3c6ed22e96f67361da654bbff8b48 (diff)
feat(lsp): ability to set DENO_DIR via settings (#11527)
Ref: denoland/vscode_deno#287
Diffstat (limited to 'cli/lsp/registries.rs')
-rw-r--r--cli/lsp/registries.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs
index 96c24b43f..d044927bc 100644
--- a/cli/lsp/registries.rs
+++ b/cli/lsp/registries.rs
@@ -254,8 +254,10 @@ pub struct ModuleRegistry {
impl Default for ModuleRegistry {
fn default() -> Self {
- let custom_root = std::env::var("DENO_DIR").map(String::into).ok();
- let dir = deno_dir::DenoDir::new(custom_root).unwrap();
+ // This only gets used when creating the tsc runtime and for testing, and so
+ // it shouldn't ever actually access the DenoDir, so it doesn't support a
+ // custom root.
+ let dir = deno_dir::DenoDir::new(None).unwrap();
let location = dir.root.join("registries");
let http_cache = HttpCache::new(&location);
let cache_setting = CacheSetting::Use;