Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit c810500

Browse files
authored
fix(panel): avoid being stuck "loading" (zbirenbaum#335)
1 parent 117a5c9 commit c810500

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/copilot/panel.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ function panel:refresh()
469469
params.position.character = params.doc.position.character
470470
end
471471

472+
-- on_solutions_done can be invoked before the api.get_panel_completions callback
473+
self.state.status = "loading"
474+
472475
local _, id = api.get_panel_completions(
473476
self.client,
474477
params,
@@ -481,7 +484,6 @@ function panel:refresh()
481484
return
482485
end
483486

484-
self.state.status = "loading"
485487
self.state.expected_count = result.solutionCountTarget
486488
panel:unlock():refresh_header():lock()
487489
end

0 commit comments

Comments
 (0)