Fix inline suggestion false negatives#325269
Draft
ulugbekna wants to merge 1 commit into
Draft
Conversation
Rebase equivalent edits into a canonical cursor-line range so every ghost-text-representable edit is recognized. Add exhaustive LF and CRLF coverage against an independent representability oracle. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes false negatives when converting equivalent edits into inline ghost-text suggestions.
Changes:
- Rebases equivalent edits to the cursor-to-line-end range.
- Preserves existing same-line and next-line behavior.
- Adds regression and exhaustive LF/CRLF coverage.
Show a summary per file
| File | Description |
|---|---|
isInlineSuggestion.ts |
Implements canonical cursor-range rebasing. |
isInlineSuggestion.spec.ts |
Adds equivalence, regression, and exhaustive tests. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Inline suggestions could be misclassified as inline edits when a provider expressed a ghost-text-compatible change using a range away from or spanning the cursor line. The existing shape-specific normalization missed valid equivalent ranges.
This change rebases candidate edits to the canonical range from the cursor to the end of its line, while verifying unchanged prefix/suffix text and the existing ghost-text constraints. It preserves exact same-line results and the established next-line insertion fallback.
The tests include the reported next-line replacement regression and an independent finite exhaustive oracle over LF and CRLF documents to verify that every representable edit is detected and remains equivalent.
Testing
npm --prefix extensions/copilot run typechecknpm --prefix extensions/copilot run test:unit -- src/extension/inlineEdits/test/vscode-node/isInlineSuggestion.spec.tsnpm run precommit