Skip to content

Commit dcaaed5

Browse files
committed
feat: bump to copilot.vim 1.13.0
1 parent ec3a846 commit dcaaed5

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

lua/copilot/api.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,21 @@ function mod.unregister_status_notification_handler(handler)
219219
status.callback[handler] = nil
220220
end
221221

222+
---@alias copilot_open_url_data { target: string }
223+
222224
mod.handlers = {
223225
PanelSolution = panel.handlers.PanelSolution,
224226
PanelSolutionsDone = panel.handlers.PanelSolutionsDone,
225227
statusNotification = status.handlers.statusNotification,
228+
---@param result copilot_open_url_data
229+
["copilot/openURL"] = function(_, result)
230+
vim.api.nvim_echo({
231+
{ "copilot/openURL" },
232+
{ vim.inspect({ _, result }) },
233+
{ "\n", "NONE" },
234+
}, true, {})
235+
error("not implemented: copilot.api.handlers['copilot/openURL']")
236+
end,
226237
}
227238
mod.panel = panel
228239
mod.status = status

lua/copilot/client.lua

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,26 @@ local function prepare_client_config(overrides)
174174

175175
M.startup_error = nil
176176

177+
local capabilities = vim.lsp.protocol.make_client_capabilities()
178+
capabilities.copilot = {
179+
openURL = true,
180+
}
181+
182+
local handlers = {
183+
PanelSolution = api.handlers.PanelSolution,
184+
PanelSolutionsDone = api.handlers.PanelSolutionsDone,
185+
statusNotification = api.handlers.statusNotification,
186+
["copilot/openURL"] = api.handlers["copilot/openURL"],
187+
}
188+
177189
return vim.tbl_deep_extend("force", {
178190
cmd = {
179191
node,
180192
agent_path,
181193
},
182194
root_dir = vim.loop.cwd(),
183195
name = "copilot",
196+
capabilities = capabilities,
184197
get_language_id = function(_, filetype)
185198
return util.language_for_file_type(filetype)
186199
end,
@@ -215,11 +228,7 @@ local function prepare_client_config(overrides)
215228
end)
216229
end
217230
end,
218-
handlers = {
219-
PanelSolution = api.handlers.PanelSolution,
220-
PanelSolutionsDone = api.handlers.PanelSolutionsDone,
221-
statusNotification = api.handlers.statusNotification,
222-
},
231+
handlers = handlers,
223232
}, overrides)
224233
end
225234

lua/copilot/suggestion.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,12 @@ local function advance(count, ctx)
403403
end
404404

405405
local function schedule()
406-
clear()
407-
408406
if not is_enabled() then
407+
clear()
409408
return
410409
end
411410

411+
update_preview()
412412
local bufnr = vim.api.nvim_get_current_buf()
413413
copilot._copilot_timer = vim.fn.timer_start(copilot.debounce, function(timer)
414414
trigger(bufnr, timer)

lua/copilot/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function M.get_editor_info()
2020
editorPluginInfo = {
2121
name = "copilot.lua",
2222
-- reflects version of github/copilot.vim
23-
version = "1.12.1",
23+
version = "1.13.0",
2424
},
2525
}
2626
return info

0 commit comments

Comments
 (0)