Automatically subscribe for lsp logs of every server added

Avoid re-adding the server on new logs events.
This commit is contained in:
Kirill Bulatov 2023-09-19 11:47:27 +03:00
parent adf313bd33
commit 91fac2aa76
2 changed files with 31 additions and 21 deletions

View file

@ -2789,18 +2789,6 @@ impl Project {
None => return Ok(None),
};
language_server
.on_notification::<lsp::notification::LogMessage, _>({
move |params, mut cx| {
if let Some(this) = this.upgrade(&cx) {
this.update(&mut cx, |_, cx| {
cx.emit(Event::LanguageServerLog(server_id, params.message))
});
}
}
})
.detach();
language_server
.on_notification::<lsp::notification::PublishDiagnostics, _>({
let adapter = adapter.clone();