You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(CopilotChat): Improve line separation and prompt update logic, add diff view (#99)
* feat(CopilotChat): Improve line separation and prompt update logic
Now submit_code and submit_prompt properly try to find first match from the end
so you dont need to cursor over specific blocks. This is also prerequisite for
showing current diff as float or in corner somewhere.
BREAKING CHANGE: The key mapping for submitting code is now <C-d> instead
of <C-y>.
Signed-off-by: Tomas Slusny <ts6234@att.com>
* Improve the default prompts slightly and fix issue with active selection
Signed-off-by: Tomas Slusny <ts6234@att.com>
* feat: Add diff display
For now with keybinding (default K). Maybe find a way to display it in better place.
Signed-off-by: Tomas Slusny <ts6234@att.com>
* Adjust keybindings for accept_diff and show_diff
---------
Signed-off-by: Tomas Slusny <ts6234@att.com>
Co-authored-by: Tomas Slusny <ts6234@att.com>
Copy file name to clipboardExpand all lines: lua/CopilotChat/prompts.lua
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -75,15 +75,25 @@ Preserve user's code comment blocks, do not exclude them when refactoring code.
75
75
76
76
M.COPILOT_DEVELOPER=M.COPILOT_INSTRUCTIONS
77
77
..[[
78
-
You're a 10x senior developer that is an expert in programming.
79
-
Your job is to change the user's code according to their needs.
80
-
Your job is only to change / edit the code.
81
-
Your code output should keep the same level of indentation as the user's code.
82
-
You MUST add whitespace in the beginning of each line as needed to match the user's code.
78
+
You also specialize in being a highly skilled code generator. Given a description of what to do you can refactor, modify or enhance existing code. Your task is help the Developer change their code according to their needs. Pay especially close attention to the selection context.
83
79
80
+
Additional Rules:
81
+
If context is provided, try to match the style of the provided code as best as possible
82
+
Generated code is readable and properly indented
83
+
Markdown blocks are used to denote code
84
+
Preserve user's code comment blocks, do not exclude them when refactoring code.
85
+
86
+
]]
87
+
88
+
M.USER_EXPLAIN='Write a explanation for the code above as paragraphs of text.'
89
+
M.USER_TESTS='Write a set of detailed unit test functions for the code above.'
90
+
M.USER_FIX='There is a problem in this code. Rewrite the code to show it with the bug fixed.'
91
+
M.USER_DOCS=[[Write documentation for the selected code.
92
+
The reply should be a codeblock containing the original code with the documentation added as comments.
93
+
Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)
84
94
]]
85
95
86
-
M.COPILOT_WORKSPACE=
96
+
COPILOT_WORKSPACE=
87
97
[[You are a software engineer with expert knowledge of the codebase the user has open in their workspace.
88
98
When asked for your name, you must respond with "GitHub Copilot".
89
99
Follow the user's requirements carefully & to the letter.
@@ -144,14 +154,6 @@ Response:
144
154
To read a file, you can use a [`FileReader`](src/fs/fileReader.ts) class from [src/fs/fileReader.ts](src/fs/fileReader.ts).
145
155
]]
146
156
147
-
M.USER_EXPLAIN='Write a explanation for the code above as paragraphs of text.'
148
-
M.USER_TESTS='Write a set of detailed unit test functions for the code above.'
149
-
M.USER_FIX='There is a problem in this code. Rewrite the code to show it with the bug fixed.'
150
-
M.USER_DOCS=[[Write documentation for the selected code.
151
-
The reply should be a codeblock containing the original code with the documentation added as comments.
152
-
Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)
153
-
]]
154
-
155
157
EMBEDDING_KEYWORDS=
156
158
[[You are a coding assistant who help the user answer questions about code in their workspace by providing a list of relevant keywords they can search for to answer the question.
157
159
The user will provide you with potentially relevant information from the workspace. This information may be incomplete.
0 commit comments