Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
feat: add CCTests command
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Dec 23, 2023
1 parent 199561c commit 1c7de7e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/CopilotChat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ M.setup = function()
utils.create_cmd('CChatExplain', function(opts)
vim.cmd('CChat Explain how it works')
end, { nargs = '*', range = true })

-- Add new command to generate unit tests with CopilotChat for selected text
utils.create_cmd('CChatTests', function(opts)
local cmd = 'CChat Generate unit tests for the code.'
-- Append the provided arguments to the command if any
if opts.args then
cmd = cmd .. ' ' .. opts.args
end
vim.cmd(cmd)
end, { nargs = '*', range = true })
end

return M

0 comments on commit 1c7de7e

Please sign in to comment.