-
Notifications
You must be signed in to change notification settings - Fork 84
Add docs for Cody edit modes #1504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gabtorre
wants to merge
1
commit into
main
Choose a base branch
from
gt/cody-edit-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Edit Modes | ||
|
|
||
| <p className="subtitle"> | ||
| Cody provides two ways to edit code: the Chat Panel Edit mode and the Quick Edit command (Alt+K). | ||
| Both apply changes inline to your files but differ in workflow and interface. | ||
| </p> | ||
|
|
||
| Cody offers powerful code editing capabilities that let you describe changes in natural language and have them applied directly to your code. There are two main ways to access this functionality: | ||
|
|
||
| - **Quick Edit (Alt+K)**: A dedicated dialog for fast, focused edits | ||
| - **Chat Panel Edit Mode**: Edit through the chat interface with a conversational record | ||
|
|
||
| ## Quick Edit (Alt+K) | ||
|
|
||
| Quick Edit provides a streamlined way to edit code without leaving your editor context. It opens a dedicated input dialog where you can describe your desired changes. | ||
|
|
||
| ### How to use Quick Edit | ||
|
|
||
| 1. Select the code you want to edit in your editor | ||
| 2. Press `Opt+K` (macOS) or `Alt+K` (Windows/Linux) | ||
| 3. Describe the change you want in the input dialog | ||
| 4. Optionally configure: | ||
| - Range selection | ||
| - Model selection | ||
| - Context items (@-mentions for files/symbols) | ||
| 5. Submit your instruction | ||
|
|
||
| Alternatively, you can: | ||
| - Right-click and select **Cody → Edit Code** | ||
| - Use the 💡 lightbulb menu with `Cmd+.` (macOS) or `Ctrl+.` (Windows/Linux) | ||
|
|
||
| ### Quick Edit workflow | ||
|
|
||
| Changes appear directly in your file with decorations showing what was modified. Code lenses appear above the changes with the following options: | ||
|
|
||
| | Action | Keyboard Shortcut | Description | | ||
| |--------|-------------------|-------------| | ||
| | Accept | `Alt+A` | Apply the suggested changes | | ||
| | Undo | `Alt+X` | Revert to the original code | | ||
| | Retry | `Alt+R` | Regenerate with a new prompt | | ||
| | Show Diff | - | View the changes in diff format | | ||
|
|
||
| ## Chat Panel Edit Mode | ||
|
|
||
| The Chat Panel Edit mode lets you request code edits through the chat interface. This is useful when you want a conversational record of your edits or prefer working within the chat panel. | ||
|
|
||
| ### How to use Chat Panel Edit mode | ||
|
|
||
| 1. Select the code you want to edit in your editor | ||
| 2. Open the Cody chat panel | ||
| 3. Click the mode selector dropdown and choose **Edit** | ||
| - Or use `Cmd+.` (macOS) or `Ctrl+.` (Windows/Linux) to cycle through modes | ||
| 4. Type your edit instruction in the chat input | ||
| 5. Submit your message | ||
|
|
||
| ### Chat Panel Edit workflow | ||
|
|
||
| When you submit an edit request through chat: | ||
|
|
||
| 1. The diff is first displayed as a formatted message in the chat panel | ||
| 2. The same inline changes and code lenses appear in your file | ||
| 3. You have both a chat record AND inline edit controls | ||
|
|
||
| This mode provides visibility into what changes Cody proposes before they appear in your file, along with a persistent record of the edit in your chat history. | ||
|
|
||
| ## Comparing the two approaches | ||
|
|
||
| | Feature | Quick Edit (Alt+K) | Chat Panel Edit Mode | | ||
| |---------|-------------------|---------------------| | ||
| | Interface | Dedicated dialog | Chat input | | ||
| | Configuration options | Range, model, @-mentions in dialog | Standard chat @-mentions | | ||
| | Result display | Inline changes only | Diff in chat + inline changes | | ||
| | Chat history | No record | Preserved in chat history | | ||
| | Keyboard shortcut | `Alt+K` / `Opt+K` | Toggle with `Cmd+.` / `Ctrl+.` | | ||
| | Best for | Quick, focused edits | Conversational editing with history | | ||
|
|
||
| ## When to use each mode | ||
|
|
||
| **Use Quick Edit (Alt+K) when you:** | ||
| - Want the fastest path to making an edit | ||
| - Don't need to keep a record of the change | ||
| - Prefer a dedicated, focused interface | ||
|
|
||
| **Use Chat Panel Edit mode when you:** | ||
| - Want to see the diff preview in chat before it's applied | ||
| - Need a conversational record of your edits | ||
| - Are already working in the chat panel | ||
| - Want to iterate on edits with follow-up messages | ||
|
|
||
| ## Shared functionality | ||
|
|
||
| Both edit modes use the same underlying system once the edit is triggered. This means you get: | ||
|
|
||
| - **Inline decorations**: Visual indicators showing added and removed code | ||
| - **Code lenses**: Accept, Undo, Retry, and Show Diff options above changes | ||
| - **Model selection**: Choose which LLM generates the edit | ||
| - **Context awareness**: Cody uses your codebase context to make informed edits | ||
|
|
||
| ## Insert mode | ||
|
|
||
| In addition to Edit mode, the chat panel also offers an **Insert** mode. While Edit mode modifies existing code, Insert mode generates new code at your cursor position. Toggle between modes using the mode selector dropdown or by pressing `Cmd+.` (macOS) or `Ctrl+.` (Windows/Linux). | ||
|
|
||
| ## Client support | ||
|
|
||
| Edit modes are available in the following Cody clients: | ||
|
|
||
| - [VS Code](/cody/clients/install-vscode) | ||
| - [JetBrains](/cody/clients/install-jetbrains) | ||
| - [Visual Studio](/cody/clients/install-visual-studio) | ||
|
|
||
| See the [feature parity reference](/cody/clients/feature-reference) for detailed client comparison. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does edit mode work the same across all three editors? I.e., same keyboard shortcuts etc?