Merge pull request #2352 from zed-industries/debounce-copilot
Debounce copilot completions
This commit is contained in:
commit
a2aad31cf1
1 changed files with 1 additions and 0 deletions
|
@ -2790,6 +2790,7 @@ impl Editor {
|
||||||
let (buffer, buffer_position) =
|
let (buffer, buffer_position) =
|
||||||
self.buffer.read(cx).text_anchor_for_position(cursor, cx)?;
|
self.buffer.read(cx).text_anchor_for_position(cursor, cx)?;
|
||||||
self.copilot_state.pending_refresh = cx.spawn_weak(|this, mut cx| async move {
|
self.copilot_state.pending_refresh = cx.spawn_weak(|this, mut cx| async move {
|
||||||
|
cx.background().timer(Duration::from_millis(75)).await;
|
||||||
let (completion, completions_cycling) = copilot.update(&mut cx, |copilot, cx| {
|
let (completion, completions_cycling) = copilot.update(&mut cx, |copilot, cx| {
|
||||||
(
|
(
|
||||||
copilot.completions(&buffer, buffer_position, cx),
|
copilot.completions(&buffer, buffer_position, cx),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue