plugins.copilot-chat.settings.prompts

Default prompts.

Type: null or (attribute set of (string or (attribute set of anything) or raw lua code))

Default: null

Plugin default:

{
  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
    '';
  };
  Docs = {
    prompt = "/COPILOT_GENERATE Please add documentation comment for the selection.";
  };
  Explain = {
    prompt = "/COPILOT_EXPLAIN Write an explanation for the active selection as paragraphs of text.";
  };
  Fix = {
    prompt = "/COPILOT_GENERATE There is a problem in this code. Rewrite the code to show it with the bug fixed.";
  };
  FixDiagnostic = {
    prompt = "Please assist with the following diagnostic issue in file:";
    selection = "require('CopilotChat.select').diagnostics";
  };
  Optimize = {
    prompt = "/COPILOT_GENERATE Optimize the selected code to improve performance and readablilty.";
  };
  Review = {
    callback = ''
      function(response, source)
        -- see config.lua for implementation
      end
    '';
    prompt = "/COPILOT_REVIEW Review the selected code.";
  };
  Tests = {
    prompt = "/COPILOT_GENERATE Please generate tests for my code.";
  };
}

Declared by:

plugins.copilot-chat.settings.prompts.<name>.callback

Callback to trigger when this prompt is executed. fun(response: string, source: CopilotChat.config.source)

Type: null or lua code string

Default: null

plugins.copilot-chat.settings.prompts.<name>.description

Description for this prompt.

Type: null or string or raw lua code

Default: null

plugins.copilot-chat.settings.prompts.<name>.kind

Kind of this prompt.

Type: null or string or raw lua code

Default: null

plugins.copilot-chat.settings.prompts.<name>.mapping

A key to bind to this prompt.

Type: null or string or raw lua code

Default: null

plugins.copilot-chat.settings.prompts.<name>.prompt

Prompt text.

Type: null or string or raw lua code

Default: null

plugins.copilot-chat.settings.prompts.<name>.selection

Selection for this prompt. fun(source: CopilotChat.config.source):CopilotChat.config.selection

Type: null or lua code string

Default: null

plugins.copilot-chat.settings.prompts.<name>.system_prompt

System prompt to use.

Type: null or string or raw lua code

Default: null