@@ -45,41 +45,50 @@ local select = require('CopilotChat.select')
4545
4646--- CopilotChat default configuration
4747--- @class CopilotChat.config
48+ --- @field debug boolean ?
49+ --- @field proxy string ?
50+ --- @field allow_insecure boolean ?
4851--- @field system_prompt string ?
4952--- @field model string ?
5053--- @field temperature number ?
51- --- @field context string ?
52- --- @field proxy string ?
53- --- @field allow_insecure boolean ?
54- --- @field debug boolean ?
54+ --- @field name string ?
55+ --- @field separator string ?
5556--- @field show_folds boolean ?
5657--- @field show_help boolean ?
57- --- @field clear_chat_on_new_prompt boolean ?
5858--- @field auto_follow_cursor boolean ?
59- --- @field name string ?
60- --- @field separator string ?
59+ --- @field clear_chat_on_new_prompt boolean ?
60+ --- @field context string ?
6161--- @field history_path string ?
6262--- @field callback fun ( response : string )?
63- --- @field prompts table<string , CopilotChat.config.prompt | string> ?
6463--- @field selection nil | fun ( source : CopilotChat.config.source ): CopilotChat.config.selection ?
64+ --- @field prompts table<string , CopilotChat.config.prompt | string> ?
6565--- @field window CopilotChat.config.window ?
6666--- @field mappings CopilotChat.config.mappings ?
6767return {
68+ debug = false , -- Enable debug logging
69+ proxy = nil , -- [protocol://]host[:port] Use this proxy
70+ allow_insecure = false , -- Allow insecure server connections
71+
6872 system_prompt = prompts .COPILOT_INSTRUCTIONS , -- System prompt to use
6973 model = ' gpt-4' , -- GPT model to use, 'gpt-3.5-turbo' or 'gpt-4'
7074 temperature = 0.1 , -- GPT temperature
71- context = ' manual' , -- Context to use, 'buffers', 'buffer' or 'manual'
72- proxy = nil , -- [protocol://]host[:port] Use this proxy
73- allow_insecure = false , -- Allow insecure server connections
74- debug = false , -- Enable debug logging
75+
76+ name = ' CopilotChat' , -- Name to use in chat
77+ separator = ' ---' , -- Separator to use in chat
7578 show_folds = true , -- Shows folds for sections in chat
7679 show_help = true , -- Shows help message as virtual lines when waiting for user input
77- clear_chat_on_new_prompt = false , -- Clears chat on every new prompt
7880 auto_follow_cursor = true , -- Auto-follow cursor in chat
79- name = ' CopilotChat' , -- Name to use in chat
80- separator = ' ---' , -- Separator to use in chat
81+ clear_chat_on_new_prompt = false , -- Clears chat on every new prompt
82+
83+ context = nil , -- Default context to use, 'buffers', 'buffer' or none (can be specified manually in prompt via @).
8184 history_path = vim .fn .stdpath (' data' ) .. ' /copilotchat_history' , -- Default path to stored history
8285 callback = nil , -- Callback to use when ask response is received
86+
87+ -- default selection (visual or line)
88+ selection = function (source )
89+ return select .visual (source ) or select .line (source )
90+ end ,
91+
8392 -- default prompts
8493 prompts = {
8594 Explain = {
@@ -112,10 +121,7 @@ return {
112121 end ,
113122 },
114123 },
115- -- default selection (visual or line)
116- selection = function (source )
117- return select .visual (source ) or select .line (source )
118- end ,
124+
119125 -- default window options
120126 window = {
121127 layout = ' vertical' , -- 'vertical', 'horizontal', 'float'
@@ -130,6 +136,7 @@ return {
130136 footer = nil , -- footer of chat window
131137 zindex = 1 , -- determines if window is on top or below other floating windows
132138 },
139+
133140 -- default mappings
134141 mappings = {
135142 close = ' q' ,
0 commit comments