Improved AI tools

This commit is contained in:
Chris
2025-04-15 20:48:35 +01:00
parent c3574de9bc
commit eeb4e44367
10 changed files with 469 additions and 9 deletions

View File

@@ -41,4 +41,34 @@ vim.api.nvim_create_autocmd("User", {
end,
})
local fidget_group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", { clear = true })
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequestStarted",
group = fidget_group,
callback = function(event)
local FidgetHelper = require('utils.fidget_helper')
-- Pass event instead of request if the callback receives the full event object
local handle = FidgetHelper:create_progress_handle(event)
FidgetHelper:store_progress_handle(event.data.id, handle)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequestFinished",
group = fidget_group,
callback = function(event)
local FidgetHelper = require('utils.fidget_helper')
-- Pass event instead of request if the callback receives the full event object
-- Pass event instead of request if the callback receives the full event object
local handle = FidgetHelper:pop_progress_handle(event.data.id)
if handle then
FidgetHelper:report_exit_status(handle, event)
handle:finish()
end
end,
})
require('helpers').edit_cf('a', '/lua/autocmd.lua')