Skip to content

Commit 2346396

Browse files
committed
add proofread command
1 parent a65343f commit 2346396

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

lua/codegpt/config.lua

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,65 +19,70 @@ local M = {}
1919

2020
---@type { [string]: codegpt.CommandOpts }
2121
local default_commands = {
22-
["completion"] = {
22+
completion = {
2323
user_message_template = "I have the following {{language}} code snippet: ```{{filetype}}\n{{text_selection}}```\nComplete the rest. Use best practices and write really good documentation. {{language_instructions}} Only return the code snippet and nothing else.",
2424
language_instructions = {
2525
cpp = "Use modern C++ features.",
2626
java = "Use modern Java syntax. Use var when applicable.",
2727
},
2828
},
29-
["generate"] = {
29+
generate = {
3030
user_message_template = "Write code in {{language}} using best practices and write really good documentation. {{language_instructions}} Only return the code snippet and nothing else. {{command_args}}",
3131
language_instructions = {
3232
cpp = "Use modern C++ features.",
3333
java = "Use modern Java syntax. Use var when applicable.",
3434
},
3535
allow_empty_text_selection = true,
3636
},
37-
["code_edit"] = {
37+
code_edit = {
3838
user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\n{{command_args}}. {{language_instructions}} Only return the code snippet and nothing else.",
3939
language_instructions = {
4040
cpp = "Use modern C++ syntax.",
4141
},
4242
},
43-
["explain"] = {
43+
explain = {
4444
user_message_template = "Explain the following {{language}} code: ```{{filetype}}\n{{text_selection}}``` Explain as if you were explaining to another developer.",
4545
callback_type = "text_popup",
4646
},
47-
["question"] = {
47+
question = {
4848
user_message_template = "I have a question about the following {{language}} code: ```{{filetype}}\n{{text_selection}}``` {{command_args}}",
4949
callback_type = "text_popup",
5050
},
51-
["debug"] = {
51+
debug = {
5252
user_message_template = "Analyze the following {{language}} code for bugs: ```{{filetype}}\n{{text_selection}}```",
5353
callback_type = "text_popup",
5454
},
55-
["doc"] = {
55+
doc = {
5656
user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\nWrite really good documentation using best practices for the given language. Attention paid to documenting parameters, return types, any exceptions or errors. {{language_instructions}} Only return the documentation snippet and nothing else.",
5757
language_instructions = {
5858
cpp = "Use doxygen style comments for functions.",
5959
java = "Use JavaDoc style comments for functions.",
6060
},
6161
},
62-
["opt"] = {
62+
opt = {
6363
user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\nOptimize this code. {{language_instructions}} Only return the code snippet and nothing else.",
6464
language_instructions = {
6565
cpp = "Use modern C++.",
6666
},
6767
},
68-
["tests"] = {
68+
tests = {
6969
user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\nWrite really good unit tests using best practices for the given language. {{language_instructions}} Only return the unit tests. Only return the code snippet and nothing else. ",
7070
callback_type = "code_popup",
7171
language_instructions = {
7272
cpp = "Use modern C++ syntax. Generate unit tests using the gtest framework.",
7373
java = "Generate unit tests using the junit framework.",
7474
},
7575
},
76-
["chat"] = {
76+
chat = {
7777
system_message_template = "You are a general assistant to a software developer.",
7878
user_message_template = "{{command_args}}",
7979
callback_type = "text_popup",
8080
},
81+
proofread = {
82+
callback_type = "text_popup",
83+
system_message_template = "You are a {{filetype}} code proofreading assistant. Review the provided code snippet for errors, potential improvements, and best practices. Consider style, correctness, and idiomatic usage. Follow any additional instructions provided by the user.",
84+
user_message_template = "I have the following code snippet to review: ```{{filetype}} {{text_selection}}```. Please proofread it for errors and provide feedback. Additional instructions: {{command_args}}",
85+
},
8186
}
8287

8388
M.model_override = nil

0 commit comments

Comments
 (0)