summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-11-27 13:25:08 -0500
committerGitHub <noreply@github.com>2022-11-27 13:25:08 -0500
commitfb04e87387e04053bf41a1512b4850adf62202c6 (patch)
treea4c57282a33b510d8638681ace10356a4c60a6e4 /cli/lsp/language_server.rs
parenta4dfc6f95553b8e2c6da78cb87a8c74a2f7c7682 (diff)
fix(npm): ensure npm package downloaded once per run when using `--reload` (#16842)
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r--cli/lsp/language_server.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index 4e7c4b240..081bbf429 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -238,22 +238,20 @@ fn create_lsp_npm_resolver(
http_client: HttpClient,
) -> NpmPackageResolver {
let registry_url = RealNpmRegistryApi::default_url();
- // Use an "only" cache setting in order to make the
- // user do an explicit "cache" command and prevent
- // the cache from being filled with lots of packages while
- // the user is typing.
- let cache_setting = CacheSetting::Only;
let progress_bar = ProgressBar::default();
let npm_cache = NpmCache::from_deno_dir(
dir,
- cache_setting.clone(),
+ // Use an "only" cache setting in order to make the
+ // user do an explicit "cache" command and prevent
+ // the cache from being filled with lots of packages while
+ // the user is typing.
+ CacheSetting::Only,
http_client.clone(),
progress_bar.clone(),
);
let api = RealNpmRegistryApi::new(
registry_url,
npm_cache.clone(),
- cache_setting,
http_client,
progress_bar,
);