-
Notifications
You must be signed in to change notification settings - Fork 43
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-edits docs #899
base: main
Are you sure you want to change the base?
Auto-edits docs #899
Changes from 4 commits
1053fda
80ecc0b
eed8724
867fa9b
35260ee
b8516a1
713d69d
4d327f1
7112fc8
b2acdd3
68091e7
58b5111
deefb1a
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,76 @@ | ||
# Auto-edits | ||
|
||
<p className="subtitle">Auto-edits suggests code changes by analyzing your 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-edits is currently in the Experimental stage for all Cody users. Enterprise users can also use this, but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/).</Callout> | ||
|
||
## Capabilities of auto-edits | ||
|
||
- Can automatically insert and delete text | ||
|
||
- Can modify code before and after the cursor position | ||
|
||
- Can handle complex refactoring operations like adding parameters and unpacking functions | ||
|
||
- Works with repetitive tasks, especially in test files | ||
|
||
- Can propose similar changes across multiple locations based on recent edits | ||
|
||
## Enable auto-edits | ||
|
||
Auto-edits is available exclusively for Pro and Enterprise users during the experimental release phase. Eligible Pro users will be gradually enrolled in the feature and will receive an in-editor notification when access is granted. | ||
|
||
### Auto-edits access for Enterprise customers | ||
|
||
**TBD -- waiting for Aravind to provide the details.** | ||
|
||
## How do auto-edits work? | ||
|
||
The system detects potential changes based on: | ||
|
||
- Cursor placement in the code | ||
|
||
- Recent changes made in similar contexts | ||
|
||
- Function usage patterns | ||
|
||
- Common refactoring patterns | ||
|
||
## Auto-edits vs. Autocomplete | ||
|
||
Autocomplete: | ||
|
||
- Can only insert text, not delete | ||
|
||
- Only proposes content after the cursor position | ||
|
||
- Suggests on every character typed | ||
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. This point looks same as Also @valerybugakov to any more limitation. 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. To be precise, our autocomplete implementation offers suggestions when we have only braces at the end of the current line but no other characters. 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.
There's also a limitation from the VS Code API: our autocomplete can only suggest content after the cursor position on the current line. So, if the model proposes an insertion into the middle or end of the following line, we don't have a way to render it. There's no such limitation for auto-edit. |
||
|
||
Auto-edits: | ||
|
||
- Can both insert and delete text | ||
|
||
- Can modify code before and after the cursor position | ||
|
||
- 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. It uses a bunch of other context sources. I think we can highlight that recent edits is important but not the only context source. 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.
Tell me :) |
||
|
||
- Can do everything autocomplete can do | ||
|
||
## Auto-edits use cases | ||
|
||
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.
Show resolved
Hide resolved
|
||
|
||
## Known limitations | ||
|
||
- Requires at least one character edit in the codebase before suggestions become active | ||
- May not propose all necessary changes in complex refactoring scenarios, requiring some manual edits | ||
jdorfman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Sometimes requires manual deletion or cleanup of code | ||
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. I'd say this isn't necessary. It's an inherent property of LLM-generated code these days. 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. line 75 "- Sometimes requires manual deletion or cleanup of code" or all lines listed? |
||
- Suggestions may not cover all similar instances of code that could be changed |
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.
Throughout the doc, we can mention
Auto-Edit
(and notAuto-edits
) as per the decision hereThere 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.
Ah, Hitesh already caught it 👍