Skip to content

Commit

Permalink
fix(denoland#10603): revert minimal changes to resolve deadlock bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed May 12, 2021
1 parent 5792778 commit 650252f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions cli/lsp/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pub struct Config {
}

impl Config {
#[allow(unused)]
pub fn contains(&self, specifier: &ModuleSpecifier) -> bool {
self.specifier_settings.contains_key(specifier)
}
Expand Down
39 changes: 20 additions & 19 deletions cli/lsp/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,25 +594,26 @@ impl Inner {
let specifier = self.url_map.normalize_url(&params.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
Expand Down

0 comments on commit 650252f

Please sign in to comment.