Avoid infinite loop when a language server fails to start
This commit is contained in:
parent
05df1dfae9
commit
19658139b1
5 changed files with 67 additions and 51 deletions
|
@ -378,8 +378,16 @@ impl LanguageServer {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn capabilities(&self) -> watch::Receiver<Option<ServerCapabilities>> {
|
||||
self.capabilities.clone()
|
||||
pub fn capabilities(&self) -> impl 'static + Future<Output = Option<ServerCapabilities>> {
|
||||
let mut rx = self.capabilities.clone();
|
||||
async move {
|
||||
loop {
|
||||
let value = rx.recv().await?;
|
||||
if value.is_some() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn request<T: request::Request>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue