Skip to content

Commit cc79063

Browse files
committed
fix: prevent agent service not initialized
fixes zbirenbaum#321
1 parent 30321e3 commit cc79063

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lua/copilot/client.lua

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ local M = {
1212
node_version = nil,
1313
node_version_error = nil,
1414
startup_error = nil,
15+
initialized = false,
1516
}
1617

1718
---@param id number
@@ -216,6 +217,7 @@ local function prepare_client_config(overrides)
216217
vim.notify(string.format("[copilot] setEditorInfo failure: %s", err), vim.log.levels.ERROR)
217218
end
218219
end)
220+
M.initialized = true
219221
end)
220222
end,
221223
on_exit = function(code, _signal, client_id)

lua/copilot/suggestion.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ local function advance(count, ctx)
402402
end
403403

404404
local function schedule(ctx)
405-
if not is_enabled() then
405+
if not is_enabled() or not c.initialized then
406406
clear()
407407
return
408408
end

0 commit comments

Comments
 (0)