Fix delay in Copilot completion (#46885)
This PR fixes an issue when copilot takes 3s to complete. Right now, in copilot edit prediction, we issue requests to both the Next Edit Suggestion (NES) and the regular copilot inline completion endpoints. Whichever come back first will be shown. However, there is a bug where even if inline completion (which is usually much faster) comes back, we still wait for NES (which takes about 3s). This should address https://github.com/zed-industries/zed/issues/46389 and https://github.com/zed-industries/zed/issues/46880 Release notes: - Improved responsiveness of Copilot inline completions.
This commit is contained in:
1 parent
74d505f232
commit
2e7c90bb53
1 file changed
+1
-1
@@ -1021,7 +1021,7 @@ impl Copilot {
|
||||
}
|
||||
inline = inline_request => {
|
||||
let completions = inline.into_response().ok().map(convert_inline).unwrap_or_default();
|
||||
if !completions.is_empty() && nes_result.is_some() {
|
||||
if !completions.is_empty() {
|
||||
return Ok(completions);
|
||||
}
|
||||
inline_result = Some(completions);
|
||||
|
||||
Reference in new issue
Block a user