diff options
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r-- | cli/lsp/language_server.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index c672f76f0..85bff7fbf 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -79,9 +79,9 @@ use crate::graph_util; use crate::http_util::HttpClient; use crate::lsp::urls::LspUrlKind; use crate::npm::create_npm_fs_resolver; +use crate::npm::CliNpmRegistryApi; use crate::npm::NpmCache; use crate::npm::NpmPackageResolver; -use crate::npm::NpmRegistry; use crate::npm::NpmResolution; use crate::proc_state::ProcState; use crate::tools::fmt::format_file; @@ -145,7 +145,7 @@ pub struct Inner { /// A lazily create "server" for handling test run requests. maybe_testing_server: Option<testing::TestServer>, /// Npm's registry api. - npm_api: NpmRegistry, + npm_api: CliNpmRegistryApi, /// Npm cache npm_cache: NpmCache, /// Npm resolution that is stored in memory. @@ -417,8 +417,13 @@ impl LanguageServer { fn create_lsp_structs( dir: &DenoDir, http_client: HttpClient, -) -> (NpmRegistry, NpmCache, NpmPackageResolver, NpmResolution) { - let registry_url = NpmRegistry::default_url(); +) -> ( + CliNpmRegistryApi, + NpmCache, + NpmPackageResolver, + NpmResolution, +) { + let registry_url = CliNpmRegistryApi::default_url(); let progress_bar = ProgressBar::new(ProgressBarStyle::TextOnly); let npm_cache = NpmCache::from_deno_dir( dir, @@ -430,7 +435,7 @@ fn create_lsp_structs( http_client.clone(), progress_bar.clone(), ); - let api = NpmRegistry::new( + let api = CliNpmRegistryApi::new( registry_url.clone(), npm_cache.clone(), http_client, |