Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions lua/copilot/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,28 @@ mod.handlers = {
PanelSolutionsDone = panel.handlers.PanelSolutionsDone,
statusNotification = status.handlers.statusNotification,
---@param result copilot_open_url_data
["copilot/openURL"] = function(_, result)
vim.api.nvim_echo({
{ "copilot/openURL" },
{ vim.inspect({ _, result }) },
{ "\n", "NONE" },
}, true, {})
error("not implemented: copilot.api.handlers['copilot/openURL']")
end,
["copilot/openURL"] = function(_, result)
local success, _ = pcall(vim.ui.open, result.target)
if not success then
if vim.ui.open ~= nil then
vim.api.nvim_echo({
{ "copilot/openURL" },
{ vim.inspect({ _, result }) },
{ "\n", "NONE" },
}, true, {})
error("Unsupported OS: vim.ui.open exists but failed to execute.")
else
vim.api.nvim_echo({
{ "copilot/openURL" },
{ vim.inspect({ _, result }) },
{ "\n", "NONE" },
}, true, {})
error("Unsupported Version: vim.ui.open requires Neovim > 0.10")
end
end
end
}

mod.panel = panel
mod.status = status

Expand Down