Limit language server reinstallation attempts

zed2 electric boogaloo
This commit is contained in:
Julia 2023-10-26 17:16:04 +02:00
parent 516236e044
commit a23e05c20b
2 changed files with 32 additions and 18 deletions

View file

@ -37,7 +37,7 @@ use std::{
path::{Path, PathBuf},
str,
sync::{
atomic::{AtomicUsize, Ordering::SeqCst},
atomic::{AtomicU64, AtomicUsize, Ordering::SeqCst},
Arc,
},
};
@ -115,6 +115,7 @@ pub struct CachedLspAdapter {
pub disk_based_diagnostics_progress_token: Option<String>,
pub language_ids: HashMap<String, String>,
pub adapter: Arc<dyn LspAdapter>,
pub reinstall_attempt_count: AtomicU64,
}
impl CachedLspAdapter {
@ -135,6 +136,7 @@ impl CachedLspAdapter {
disk_based_diagnostics_progress_token,
language_ids,
adapter,
reinstall_attempt_count: AtomicU64::new(0),
})
}