Faster completion support for remotes #17993
Conversation
Before this change we cancled every completion task on each keystroke. This works fine when the latency to the LSP is low, but on a remote that may be a few hundred ms away, this means you are always having to wait until the completions show. Co-Authored-By: Maan2003 <manmeetmann2003@gmail.com>
|
supersedes #17954, so I can also push changes |
| // the task didn't get cancelled, so we manually return | ||
| return; |
There was a problem hiding this comment.
otherwise completions from this show sometimes after this.
658dd13 to
2ffca51
Compare
|
latency saved is time taken to type the last word before completion. |
|
noticed that filtering completions can be really slow in some cases from logs and looks like filter is running multiple times per keystroke |
|
just dropping completions future doesn't cancel the request to remote server (tested in ssh case). and rust analyzer sends huge completions response every time (~800KB) due to including docs. this delays future responses because you have to wait for x * 800KB data to be received where x is number of keystrokes |
|
just fyi @maan2003, @SomeoneToIgnore has recently landed a PR which significantly reduces the amount of data sent back by RA: rust-lang/rust-analyzer#18167 |
|
nice! |
|
This looks somewhat stale and outdates, so I'll close this to keep the PR queue cleaner. |
Before this change we canceled every completion task on each keystroke.
This works fine when the latency to the LSP is low, but on a remote that
may be a few hundred ms away, this means you are always having to wait
until the completions show.
This also help if language server takes a while to respond to completion requests.
Release Notes: