React on message-less LSP requests properly
Co-Authored-By: Julia Risley <julia@zed.dev>
This commit is contained in:
parent
7a268b1cf6
commit
f83cfda9bc
4 changed files with 5 additions and 12 deletions
|
@ -1339,8 +1339,7 @@ impl Editor {
|
|||
}));
|
||||
project_subscriptions.push(cx.subscribe(project, |editor, _, event, cx| {
|
||||
match event {
|
||||
project::Event::LanguageServerReady(_) => {
|
||||
dbg!("@@@@@@@@@@@@@ ReceiveD event");
|
||||
project::Event::ReloadInlayHints => {
|
||||
editor.update_inlay_hints(cx);
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -1821,7 +1821,6 @@ impl LineWithInvisibles {
|
|||
|
||||
// TODO kb bad: syscalls + cloning happen very frequently, check the timestamp first
|
||||
let new_hints = editor.inlay_hints.read();
|
||||
dbg!(new_hints.last());
|
||||
|
||||
self.draw_invisibles(
|
||||
&selection_ranges,
|
||||
|
|
|
@ -615,6 +615,7 @@ impl LanguageServer {
|
|||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
Err(error) => {
|
||||
log::error!(
|
||||
"error deserializing {} request: {:?}, message: {:?}",
|
||||
|
|
|
@ -254,7 +254,6 @@ pub enum Event {
|
|||
LanguageServerAdded(LanguageServerId),
|
||||
LanguageServerRemoved(LanguageServerId),
|
||||
LanguageServerLog(LanguageServerId, String),
|
||||
LanguageServerReady(LanguageServerId),
|
||||
Notification(String),
|
||||
ActiveEntryChanged(Option<ProjectEntryId>),
|
||||
WorktreeAdded,
|
||||
|
@ -278,6 +277,7 @@ pub enum Event {
|
|||
new_peer_id: proto::PeerId,
|
||||
},
|
||||
CollaboratorLeft(proto::PeerId),
|
||||
ReloadInlayHints,
|
||||
}
|
||||
|
||||
pub enum LanguageServerState {
|
||||
|
@ -2813,19 +2813,13 @@ impl Project {
|
|||
|
||||
language_server
|
||||
.on_request::<lsp::request::InlayHintRefreshRequest, _, _>({
|
||||
dbg!("!!!!!!!!!!!!!!");
|
||||
let this = this.downgrade();
|
||||
move |params, mut cx| async move {
|
||||
// TODO kb does not get called now, why?
|
||||
dbg!("#########################");
|
||||
|
||||
move |(), mut cx| async move {
|
||||
let this = this
|
||||
.upgrade(&cx)
|
||||
.ok_or_else(|| anyhow!("project dropped"))?;
|
||||
dbg!(params);
|
||||
this.update(&mut cx, |_, cx| {
|
||||
dbg!("@@@@@@@@@@@@@ SENT event");
|
||||
cx.emit(Event::LanguageServerReady(server_id));
|
||||
cx.emit(Event::ReloadInlayHints);
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue