diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-12-31 14:33:44 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-31 14:33:44 +1100 |
commit | 587155f86dbce71b274bbeeb2c60c9a2798cf600 (patch) | |
tree | 575a0d4cf768d5652775547d112ffeead468baca /cli/lsp/diagnostics.rs | |
parent | 0163cedd804110cd410eb2cb92b299b0e555527f (diff) |
feat(lsp): support specifying a tsconfig file (#8926)
Diffstat (limited to 'cli/lsp/diagnostics.rs')
-rw-r--r-- | cli/lsp/diagnostics.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index e7be61cdc..96bb89d75 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -81,7 +81,7 @@ pub async fn generate_lint_diagnostics( tokio::task::spawn_blocking(move || { let mut diagnostic_list = Vec::new(); - let file_cache = state_snapshot.file_cache.read().unwrap(); + let file_cache = state_snapshot.file_cache.lock().unwrap(); for (specifier, doc_data) in state_snapshot.doc_data.iter() { let file_id = file_cache.lookup(specifier).unwrap(); let version = doc_data.version; @@ -242,7 +242,7 @@ pub async fn generate_ts_diagnostics( for (specifier, doc_data) in state_snapshot_.doc_data.iter() { let file_id = { // TODO(lucacasonato): this is highly inefficient - let file_cache = state_snapshot_.file_cache.read().unwrap(); + let file_cache = state_snapshot_.file_cache.lock().unwrap(); file_cache.lookup(specifier).unwrap() }; let version = doc_data.version; @@ -266,8 +266,8 @@ pub async fn generate_dependency_diagnostics( tokio::task::spawn_blocking(move || { let mut diagnostics = Vec::new(); - let file_cache = state_snapshot.file_cache.read().unwrap(); - let mut sources = if let Ok(sources) = state_snapshot.sources.write() { + let file_cache = state_snapshot.file_cache.lock().unwrap(); + let mut sources = if let Ok(sources) = state_snapshot.sources.lock() { sources } else { return Err(custom_error("Deadlock", "deadlock locking sources")); |