-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: chain of next edits #6843
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
feat: chain of next edits #6843
Conversation
…d the editable region start and end lines
…hen the decoration should be rendered inside the viewport
…ancement/next-editable-region
| let outcome: AutocompleteOutcome | NextEditOutcome | undefined; | ||
| const completionId = uuidv4(); | ||
| const filepath = document.uri.toString(); | ||
| const recentlyVisitedRanges = this.recentlyVisitedRanges.getSnippets(); | ||
| let recentlyEditedRanges = | ||
| await this.recentlyEditedTracker.getRecentlyEditedRanges(); | ||
|
|
||
| if (this.nextEditProvider.chainExists()) { | ||
| // The chain of edits is alive because the user has accepted the previous completion. | ||
| // Get the next editable region and set the pos to be within that range. | ||
| outcome = | ||
| await this.nextEditProvider.provideInlineCompletionItemsWithChain( |
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.
Maybe a helper function for this condition
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.
This will be a really substantial change, that I would like to address in a future cleanup PR. Currently the logic changes pretty often, so addressing this in this PR seems like a premature optimization.
| // The logic is largely similar to that of completionProvider.ts | ||
| // but we don't have access to the class. | ||
|
|
||
| const { completionId, outcome, currentPosition } = data; |
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.
Possible duplicate of completionProvider.ts
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.
This will be a really substantial change, that I would like to address in a future cleanup PR. Currently the logic changes pretty often, so addressing this in this PR seems like a premature optimization.
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Closes CON-2819, CON-2925.
Users can now jump to the next editable region within a file.
Provided four strategies for calculating next editable region.
Checklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
Added to
core/nextEdit/diff/diff.vitest.tsCreated
extensions/vscode/src/autocomplete/GhostTextAcceptanceTracker.vitest.tsSummary by cubic
Added the ability for users to jump to the next editable region in a file, with four strategies for finding the next region. This improves navigation and editing efficiency, addressing requirements from CON-2819 and CON-2925.
New Features
Dependencies