summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/lsp/language_server.rs2
-rw-r--r--cli/lsp/registries.rs16
2 files changed, 15 insertions, 3 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index c38b36c69..be4b23ff7 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -43,6 +43,7 @@ use super::documents::to_lsp_range;
use super::documents::AssetOrDocument;
use super::documents::Documents;
use super::documents::LanguageId;
+use super::logging::lsp_log;
use super::lsp_custom;
use super::parent_process_checker;
use super::performance::Performance;
@@ -63,7 +64,6 @@ use crate::deno_dir;
use crate::file_fetcher::get_source_from_data_url;
use crate::fs_util;
use crate::logger;
-use crate::lsp::logging::lsp_log;
use crate::proc_state::import_map_from_text;
use crate::tools::fmt::format_file;
use crate::tools::fmt::format_parsed_source;
diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs
index 94c3c49fc..418c19fe3 100644
--- a/cli/lsp/registries.rs
+++ b/cli/lsp/registries.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+use super::logging::lsp_log;
use super::path_to_regex::parse;
use super::path_to_regex::string_to_regex;
use super::path_to_regex::Compiler;
@@ -544,8 +545,19 @@ impl ModuleRegistry {
// we can't use entry().or_insert_with() because we can't use async closures
if !self.origins.contains_key(&origin) {
let specifier = origin_url.join(CONFIG_PATH)?;
- let configs = self.fetch_config(&specifier).await?;
- self.origins.insert(origin, configs);
+ match self.fetch_config(&specifier).await {
+ Ok(configs) => {
+ self.origins.insert(origin, configs);
+ }
+ Err(err) => {
+ lsp_log!(
+ " Error fetching registry config for \"{}\": {}",
+ origin,
+ err.to_string()
+ );
+ self.origins.remove(&origin);
+ }
+ }
}
Ok(())