Skip to content

Conversation

@jpoly1219
Copy link
Contributor

@jpoly1219 jpoly1219 commented Jul 29, 2025

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

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

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.ts
Created extensions/vscode/src/autocomplete/GhostTextAcceptanceTracker.vitest.ts


Summary 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

    • Implemented next editable region jump with naive, rerank, static rerank, and static strategies.
    • Added a Jump Manager to handle jump state and UI in VS Code.
    • Introduced a document history tracker to cache ASTs and original file states.
    • Added commands and UI for accepting or rejecting jump suggestions.
  • Dependencies

    • Added new LSP methods: getReferences and getDocumentSymbols.
    • Updated package dependencies for OpenAI and related adapters.

jpoly1219 added 30 commits July 14, 2025 16:41
…hen the decoration should be rendered inside the viewport
@jpoly1219 jpoly1219 changed the title Jacob/enhancement/next editable region Jacob/enhancement/con 2819 Jul 30, 2025
@jpoly1219 jpoly1219 changed the title Jacob/enhancement/con 2819 Jacob/con 2819 Jul 30, 2025
@jpoly1219 jpoly1219 changed the title Jacob/con 2819 feat: chain of next edits Jul 30, 2025
Comment on lines +232 to +243
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(
Copy link
Contributor

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

Copy link
Contributor Author

@jpoly1219 jpoly1219 Jul 30, 2025

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;
Copy link
Contributor

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

Copy link
Contributor Author

@jpoly1219 jpoly1219 Jul 30, 2025

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.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jul 30, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 30, 2025
@tomasz-stefaniak tomasz-stefaniak merged commit db43622 into main Jul 30, 2025
37 of 38 checks passed
@tomasz-stefaniak tomasz-stefaniak deleted the jacob/enhancement/next-editable-region branch July 30, 2025 22:16
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jul 30, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2025
@github-actions github-actions bot added the tier 1 Big feature that took multiple weeks to launch and represents a big milestone for the product label Jul 30, 2025
@sestinj
Copy link
Contributor

sestinj commented Aug 18, 2025

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Aug 18, 2025

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:XXL This PR changes 1000+ lines, ignoring generated files. tier 1 Big feature that took multiple weeks to launch and represents a big milestone for the product

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants