From 650252f88aef2fed862a801c84e0244584e37af6 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 12 May 2021 11:54:48 +1000 Subject: [PATCH] fix(#10603): revert minimal changes to resolve deadlock bug --- cli/lsp/config.rs | 1 + cli/lsp/language_server.rs | 39 +++++++++++++++++++------------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index bc41fd02abfc95..441b2cc99ddfc4 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -148,6 +148,7 @@ pub struct Config { } impl Config { + #[allow(unused)] pub fn contains(&self, specifier: &ModuleSpecifier) -> bool { self.specifier_settings.contains_key(specifier) } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 5ed6f693c2e46f..2f090938ca1bb3 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -594,25 +594,26 @@ impl Inner { let specifier = self.url_map.normalize_url(¶ms.text_document.uri); // we only query the individual resource file if the client supports it - if self.config.client_capabilities.workspace_configuration - && !self.config.contains(&specifier) - { - if let Ok(value) = self - .client - .configuration(vec![ConfigurationItem { - scope_uri: Some(params.text_document.uri.clone()), - section: Some(SETTINGS_SECTION.to_string()), - }]) - .await - { - if let Err(err) = self - .config - .update_specifier(specifier.clone(), value[0].clone()) - { - warn!("Error updating specifier configuration: {}", err); - } - } - } + // TODO(@kitsonk) workaround https://github.com/denoland/deno/issues/10603 + // if self.config.client_capabilities.workspace_configuration + // && !self.config.contains(&specifier) + // { + // if let Ok(value) = self + // .client + // .configuration(vec![ConfigurationItem { + // scope_uri: Some(params.text_document.uri.clone()), + // section: Some(SETTINGS_SECTION.to_string()), + // }]) + // .await + // { + // if let Err(err) = self + // .config + // .update_specifier(specifier.clone(), value[0].clone()) + // { + // warn!("Error updating specifier configuration: {}", err); + // } + // } + // } if params.text_document.uri.scheme() == "deno" { // we can ignore virtual text documents opening, as they don't need to