Skip to content

Commit c3518e5

Browse files
chore(doc): auto generate docs
1 parent 50b3946 commit c3518e5

File tree

1 file changed

+55
-18
lines changed

1 file changed

+55
-18
lines changed

doc/CopilotChat.txt

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,54 @@ COMMANDS ~
139139
- `:CopilotChatAgents` - View and select available agents. This is reset when a new instance is made. Please set your agent in `init.lua` for persistence.
140140

141141

142-
COMMANDS COMING FROM DEFAULT PROMPTS
142+
PROMPTS ~
143143

144-
- `:CopilotChatExplain` - Write an explanation for the selected code and diagnostics as paragraphs of text
145-
- `:CopilotChatReview` - Review the selected code
146-
- `:CopilotChatFix` - There is a problem in this code. Rewrite the code to show it with the bug fixed
147-
- `:CopilotChatOptimize` - Optimize the selected code to improve performance and readability
148-
- `:CopilotChatDocs` - Please add documentation comments to the selected code
149-
- `:CopilotChatTests` - Please generate tests for my code
150-
- `:CopilotChatCommit` - Write commit message for the change with commitizen convention
144+
You can ask Copilot to do various tasks with prompts. You can reference prompts
145+
with `/PromptName` in chat or call with command `:CopilotChat<PromptName>`.
146+
Default prompts are:
151147

148+
- `Explain` - Write an explanation for the selected code and diagnostics as paragraphs of text
149+
- `Review` - Review the selected code
150+
- `Fix` - There is a problem in this code. Rewrite the code to show it with the bug fixed
151+
- `Optimize` - Optimize the selected code to improve performance and readability
152+
- `Docs` - Please add documentation comments to the selected code
153+
- `Tests` - Please generate tests for my code
154+
- `Commit` - Write commit message for the change with commitizen convention
152155

153-
MODELS, AGENTS AND CONTEXTS ~
154156

157+
SYSTEM PROMPTS ~
155158

156-
MODELS
159+
System prompts specify the behavior of the AI model. You can reference system
160+
prompts with `/PROMPT_NAME` in chat. Default system prompts are:
161+
162+
- `COPILOT_INSTRUCTIONS` - Base GitHub Copilot instructions
163+
- `COPILOT_EXPLAIN` - On top of the base instructions adds coding tutor behavior
164+
- `COPILOT_REVIEW` - On top of the base instructions adds code review behavior with instructions on how to generate diagnostics
165+
- `COPILOT_GENERATE` - On top of the base instructions adds code generation behavior, with predefined formatting and generation rules
166+
167+
168+
STICKY PROMPTS ~
169+
170+
You can set sticky prompt in chat by prefixing the text with `>` using markdown
171+
blockquote syntax. The sticky prompt will be copied at start of every new
172+
prompt in chat window. You can freely edit the sticky prompt, only rule is `>`
173+
prefix at beginning of line. This is useful for preserving stuff like context
174+
and agent selection (see below). Example usage:
175+
176+
>markdown
177+
> #files
178+
179+
List all files in the workspace
180+
<
181+
182+
>markdown
183+
> @models Using Mistral-small
184+
185+
What is 1 + 11
186+
<
187+
188+
189+
MODELS ~
157190

158191
You can list available models with `:CopilotChatModels` command. Model
159192
determines the AI model used for the chat. Default models are:
@@ -170,7 +203,7 @@ using `@models` agent from here <https://github.com/marketplace/models-github>
170203
(example: `@models Using Mistral-small, what is 1 + 11`)
171204

172205

173-
AGENTS
206+
AGENTS ~
174207

175208
Agents are used to determine the AI agent used for the chat. You can list
176209
available agents with `:CopilotChatAgents` command. You can set the agent in
@@ -183,7 +216,7 @@ You can install more agents from here
183216
<https://github.com/marketplace?type=apps&copilot_app=true>
184217

185218

186-
CONTEXTS
219+
CONTEXTS ~
187220

188221
Contexts are used to determine the context of the chat. You can set the context
189222
in the prompt by using `#` followed by the context name. Supported contexts
@@ -306,25 +339,25 @@ Also see here </lua/CopilotChat/config.lua>:
306339
-- default prompts
307340
prompts = {
308341
Explain = {
309-
prompt = '/COPILOT_EXPLAIN Write an explanation for the selected code and diagnostics as paragraphs of text.',
342+
prompt = '> /COPILOT_EXPLAIN\n\nWrite an explanation for the selected code and diagnostics as paragraphs of text.',
310343
},
311344
Review = {
312-
prompt = '/COPILOT_REVIEW Review the selected code.',
345+
prompt = '> /COPILOT_REVIEW\n\nReview the selected code.',
313346
callback = function(response, source)
314347
-- see config.lua for implementation
315348
end,
316349
},
317350
Fix = {
318-
prompt = '/COPILOT_GENERATE There is a problem in this code. Rewrite the code to show it with the bug fixed.',
351+
prompt = '> /COPILOT_GENERATE\n\nThere is a problem in this code. Rewrite the code to show it with the bug fixed.',
319352
},
320353
Optimize = {
321-
prompt = '/COPILOT_GENERATE Optimize the selected code to improve performance and readability.',
354+
prompt = '> /COPILOT_GENERATE\n\nOptimize the selected code to improve performance and readability.',
322355
},
323356
Docs = {
324-
prompt = '/COPILOT_GENERATE Please add documentation comments to the selected code.',
357+
prompt = '> /COPILOT_GENERATE\n\nPlease add documentation comments to the selected code.',
325358
},
326359
Tests = {
327-
prompt = '/COPILOT_GENERATE Please generate tests for my code.',
360+
prompt = '> /COPILOT_GENERATE\n\nPlease generate tests for my code.',
328361
},
329362
Commit = {
330363
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.',
@@ -365,6 +398,10 @@ Also see here </lua/CopilotChat/config.lua>:
365398
normal = '<CR>',
366399
insert = '<C-s>'
367400
},
401+
toggle_sticky = {
402+
detail = 'Makes line under cursor sticky or deletes sticky line.',
403+
normal = 'gr',
404+
},
368405
accept_diff = {
369406
normal = '<C-y>',
370407
insert = '<C-y>'

0 commit comments

Comments
 (0)