-
Notifications
You must be signed in to change notification settings - Fork 76
Auto-edit docs #899
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
Auto-edit docs #899
Changes from 16 commits
1053fda
80ecc0b
eed8724
867fa9b
35260ee
b8516a1
713d69d
4d327f1
7112fc8
b2acdd3
68091e7
58b5111
deefb1a
8ccc0a9
64ce07c
46adec8
fb64839
0c8b350
9961cb6
94dc92d
6a10d16
7ff0d65
c11b266
c438e0e
24deab9
1b0e878
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Auto-edit | ||
|
|
||
| <p className="subtitle">Auto-edit suggests code changes by analyzing cursor movements and typing. After you've made at least one character edit in your codebase, it begins proposing contextual modifications based on your cursor position and recent changes.</p> | ||
|
|
||
| <Callout type="info">Auto-edit is currently available in VS Code extension in the Experimental stage for all Cody Pro users and Enterprise users on Cody Gateway.</Callout> | ||
|
|
||
| ## Capabilities of auto-edit | ||
|
|
||
| - Can automatically insert and delete text | ||
| - Can modify code before and after the cursor position | ||
| - Works with repetitive tasks, especially in test files | ||
| - Can propose similar changes across multiple locations based on recent edits | ||
| - Can handle complex refactoring operations like adding parameters and unpacking functions | ||
|
|
||
| ## Enabling auto-edit | ||
|
|
||
| Eligible Cody Pro users will gradually be given access to the auto-edit feature. Once you have it, you will receive an in-editor notification. | ||
|
|
||
|  | ||
|
|
||
| ### Auto-edit access for Enterprise customers | ||
|
|
||
| Auto-edit is available for Enterprise customers with [Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway#sourcegraph-cody-gateway) access. Enabling the feature requires two steps: | ||
|
|
||
| 1. Site administrators must enable the feature flag `cody-autoedit-experiment-enabled-flag` | ||
| 2. Once enabled, developers will receive a notification in their editor to turn it on | ||
jdorfman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
jdorfman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## How does auto-edit work? | ||
|
|
||
| The system detects potential changes based on the following: | ||
|
|
||
| - Cursor placement in the code | ||
| - Recent changes made in similar contexts | ||
| - Function usage patterns | ||
| - Common refactoring patterns | ||
|
|
||
| ## Auto-edit vs. Autocomplete | ||
|
|
||
| In terms of feature-set and functionality, auto-edit and autocomplete have some key differences: | ||
|
|
||
| | **Feature** | **Autocomplete** | **Auto-edit** | | ||
| | ---------------------- | -------------------------------------- | -------------------------------------------------- | | ||
| | **Text modification** | Can only insert text, not delete | Can both insert and delete text | | ||
| | **Cursor position** | Only proposes content after the cursor | Can modify code before and after the cursor | | ||
| | **Suggestion trigger** | Suggests on every character typed | Proposes changes based on context and recent edits | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the amazing doc @MaedahBatool |
||
| | **Scope** | - | Can do everything autocomplete can do | | ||
jdorfman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Use cases | ||
|
|
||
| The auto-edit feature can help you with various repetitive tasks in your code: | ||
|
|
||
| 1. Function signature refactoring (adding error returns) | ||
| 2. Updating function call sites after signature changes | ||
| 3. Repetitive modifications in test files | ||
| 4. Parameter additions and function unpacking | ||
| 5. Type system updates across multiple locations | ||
|
|
||
jdorfman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ## Known limitations | ||
|
|
||
jdorfman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Requires at least one character edit in the codebase before suggestions become active | ||
jdorfman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - May not propose all necessary changes in complex refactoring scenarios, requiring some manual edits | ||
| - Suggestions are limited to a fixed number of lines around the cursor | ||
| - Sometimes requires manual deletion or cleanup of code | ||
jdorfman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Suggestions may not cover all similar instances of code that could be changed | ||
Uh oh!
There was an error while loading. Please reload this page.