mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
fix(lsp): reduce deadlocks with in memory documents (#9259)
This commit is contained in:
parent
1f8b83ba1a
commit
2b4e0be43c
3 changed files with 28 additions and 59 deletions
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue