Skip to content

Commit

Permalink
plugins/copilot-chat: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Mar 4, 2025
1 parent 780a0c5 commit 0747f55
Showing 1 changed file with 34 additions and 83 deletions.
117 changes: 34 additions & 83 deletions tests/test-sources/plugins/by-name/copilot-chat/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,24 @@
plugins.copilot-chat = {
enable = true;

# https://github.com/CopilotC-Nvim/CopilotChat.nvim/blob/main/lua/CopilotChat/config.lua
settings = {
debug = false;
proxy = null;
allow_insecure = false;
system_prompt = "require('CopilotChat.prompts').COPILOT_INSTRUCTIONS";
model = "gpt-4";
temperature = 0.1;
question_header = "## User ";
answer_header = "## Copilot ";
error_header = "## Error ";
separator = "───";
show_folds = true;
show_help = true;
auto_follow_cursor = true;
auto_insert_mode = false;
clear_chat_on_new_prompt = false;
highlight_selection = true;
system_prompt = "require('CopilotChat.config.prompts').COPILOT_INSTRUCTIONS";
model = "gpt-4-o";
agent = "none";
context = null;
history_path.__raw = "vim.fn.stdpath('data') .. '/copilotchat_history'";
sticky = null;

temperature = 0.1;
headless = false;
callback = null;
selection = ''

selection.__raw = ''
function(source)
local select = require('CopilotChat.select')
return select.visual(source) or select.line(source)
return select.visual(source) or select.buffer(source)
end
'';
prompts = {
Explain.prompt = "/COPILOT_EXPLAIN Write an explanation for the active selection as paragraphs of text.";
Review = {
prompt = "/COPILOT_REVIEW Review the selected code.";
callback = ''
function(response, source)
-- see config.lua for implementation
end
'';
};
Fix.prompt = "/COPILOT_GENERATE There is a problem in this code. Rewrite the code to show it with the bug fixed.";
Optimize.prompt = "/COPILOT_GENERATE Optimize the selected code to improve performance and readablilty.";
Docs.prompt = "/COPILOT_GENERATE Please add documentation comment for the selection.";
Tests.prompt = "/COPILOT_GENERATE Please generate tests for my code.";
FixDiagnostic = {
prompt = "Please assist with the following diagnostic issue in file:";
selection = "require('CopilotChat.select').diagnostics";
};
Commit = {
prompt = "Write commit message for the change with commitizen convention. Make sure the title has maximum 50 characters and message is wrapped at 72 characters. Wrap the whole message in code block with language gitcommit.";
selection = "require('CopilotChat.select').gitdiff";
};
CommitStaged = {
prompt = "Write commit message for the change with commitizen convention. Make sure the title has maximum 50 characters and message is wrapped at 72 characters. Wrap the whole message in code block with language gitcommit.";
selection = ''
function(source)
return select.gitdiff(source, true)
end
'';
};
};

window = {
layout = "vertical";
Expand All @@ -78,39 +39,29 @@
footer = null;
zindex = 1;
};
mappings = {
complete.insert = "<Tab>";
close = {
normal = "q";
insert = "<C-c>";
};
reset = {
normal = "<C-l>";
insert = "<C-l>";
};
submit_prompt = {
normal = "<CR>";
insert = "<C-s>";
};
toggle_sticky = {
detail = "Makes line under cursor sticky or deletes sticky line.";
normal = "gr";
};
accept_diff = {
normal = "<C-y>";
insert = "<C-y>";
};
jump_to_diff.normal = "gj";
quickfix_diffs.normal = "gq";
yank_diff = {
normal = "gy";
register = "\"";
};
show_diff.normal = "gd";
show_info.normal = "gi";
show_context.normal = "gc";
show_help.normal = "gh";
};

show_help = true;
show_folds = true;
highlight_selection = true;
highlight_headers = true;
auto_follow_cursor = true;
auto_insert_mode = false;
insert_at_end = false;

debug = false;
log_level = "info";
proxy = null;
allow_insecure = false;

chat_autocomplete = true;

log_path.__raw = "vim.fn.stdpath('state') .. '/CopilotChat.log'";
history_path.__raw = "vim.fn.stdpath('data') .. '/copilotchat_history'";

question_header = "## User ";
answer_header = "## Copilot ";
error_header = "## Error ";
separator = "───";
};
};
};
Expand Down

0 comments on commit 0747f55

Please sign in to comment.