diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-01-26 10:47:12 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 10:47:12 +1100 |
commit | 2b4e0be43c273d2c1bcdc7640aa80ae03f137113 (patch) | |
tree | e7c8dd0f9c77c7e47e42c4a20d781431392d7e0d /cli/lsp/language_server.rs | |
parent | 1f8b83ba1aafd2c25c24c00eb7a117588a34b3f9 (diff) |
fix(lsp): reduce deadlocks with in memory documents (#9259)
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r-- | cli/lsp/language_server.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 316aabf91..2ccbb6284 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -58,7 +58,7 @@ pub struct LanguageServer { #[derive(Debug, Clone, Default)] pub struct StateSnapshot { pub assets: Arc<Mutex<HashMap<ModuleSpecifier, Option<AssetDocument>>>>, - pub documents: Arc<Mutex<DocumentCache>>, + pub documents: DocumentCache, pub sources: Arc<Mutex<Sources>>, } @@ -289,7 +289,7 @@ impl LanguageServer { pub fn snapshot(&self) -> StateSnapshot { StateSnapshot { assets: self.assets.clone(), - documents: self.documents.clone(), + documents: self.documents.lock().unwrap().clone(), sources: self.sources.clone(), } } |