Skip to content

Commit

Permalink
fix(panel): avoid being stuck "loading" (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
liskin authored Dec 4, 2024
1 parent 117a5c9 commit c810500
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/copilot/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ function panel:refresh()
params.position.character = params.doc.position.character
end

-- on_solutions_done can be invoked before the api.get_panel_completions callback
self.state.status = "loading"

local _, id = api.get_panel_completions(
self.client,
params,
Expand All @@ -481,7 +484,6 @@ function panel:refresh()
return
end

self.state.status = "loading"
self.state.expected_count = result.solutionCountTarget
panel:unlock():refresh_header():lock()
end
Expand Down

0 comments on commit c810500

Please sign in to comment.