mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
feat(lsp): ability to set DENO_DIR via settings (#11527)
Ref: denoland/vscode_deno#287
This commit is contained in:
parent
fd0b24b246
commit
667b026798
18 changed files with 213 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue