Regenerate completion labels on resolve (#21521)

Closes https://github.com/zed-industries/zed/issues/21516

Technically, this is an LSP violation from `vtsls`, but seems that it's
not going to be fixed adequately on that side, see
https://github.com/yioneko/vtsls/issues/213 for more context.
So, we have to accommodate at least for now.

Release Notes:

- Fixed completion item labels not being updated after the resolve for
non-LSP compliant servers
This commit is contained in:
Kirill Bulatov 2024-12-04 23:37:24 +02:00 committed by GitHub
parent 8d18dfa4c1
commit 55ecb3c51b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 124 additions and 6 deletions

View file

@ -1181,9 +1181,9 @@ impl CompletionsMenu {
let delay = Duration::from_millis(delay_ms);
completion_resolve.lock().fire_new(delay, cx, |_, cx| {
cx.spawn(move |this, mut cx| async move {
cx.spawn(move |editor, mut cx| async move {
if let Some(true) = resolve_task.await.log_err() {
this.update(&mut cx, |_, cx| cx.notify()).ok();
editor.update(&mut cx, |_, cx| cx.notify()).ok();
}
})
});