Skip to content

Commit 8bb5a43

Browse files
committed
feat: add 'f' code_only reg and update variable_explain template
1 parent e26a6b8 commit 8bb5a43

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

lua/simplegpt/conf.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ local M = {
180180
suffix = "v",
181181
tpl = "variable_explain.json",
182182
target = "popup",
183+
reg = {
184+
f = format.code_only,
185+
},
183186
opts = { noremap = true, silent = true, desc = "Add Doc For (V)ariable" },
184187
},
185188
{

qa_tpls/variable_explain.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"q": "Please create a piece of comments that I can insert into the code.\nThe following content should be included in the comments.\n- The type of the variable\n- A very concrete example of the variable", "t": "You are an expert in programming.\n{% if p %}\nHere are a list of files for reference.\n{{p-}}\n{% endif %}\n\nWe have a file named {{filename}} with content:\n````{{filetype}} \n{{content}}\n````\n\n{%if terminal%}\nHere is some related output from the terminal\n```\n{{terminal}}\n```\n{% endif %}\n\nHere is the location of your current line.\n{{context_line_num}}\n\nYou are focusing on the variable `{% if visual %}{{visual}}{% else %}{{cword}}{% endif %}` in current line\n\n\n{{q}}"}
1+
{"q": "Please create a piece of comments that I can insert into the code.\nThe following content should be included in the comments.\n- The type of the variable\n- A very concrete example of the variable", "t": "You are an expert in programming.\n{% if p %}\nHere are a list of files for reference.\n{{p-}}\n{% endif %}\n\nWe have a file named {{filename}} with content:\n````{{filetype}} \n{{content}}\n````\n\n{%if terminal%}\nHere is some related output from the terminal\n```\n{{terminal}}\n```\n{% endif %}\n\nHere is the location of your current line.\n{{context_line_num}}\n\nYou are focusing on the variable `{% if visual %}{{visual}}{% else %}{{cword}}{% endif %}` in current line\n\n{{f}}\n\n{{q}}", "f": "No extra explanations.\nNo block quotes. DO NOT include three backticks ``` in the code. Try to keep all the comments (You can modify them to make it better).\nKeep original indent so that we can replace the original code with the newly generated one.\nWhen we have multiple loops of conversations, don't assume that previous modifications have been made. You are still changing the initial version of the code.\nOnly return the signature and the document."}

0 commit comments

Comments
 (0)