Skip to content

Fix inline suggestion false negatives#325269

Draft
ulugbekna wants to merge 1 commit into
mainfrom
ulugbekna/fix-inline-suggestion-detection
Draft

Fix inline suggestion false negatives#325269
ulugbekna wants to merge 1 commit into
mainfrom
ulugbekna/fix-inline-suggestion-detection

Conversation

@ulugbekna

Copy link
Copy Markdown
Contributor

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 typecheck
  • npm --prefix extensions/copilot run test:unit -- src/extension/inlineEdits/test/vscode-node/isInlineSuggestion.spec.ts
  • npm run precommit

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>
Copilot AI review requested due to automatic review settings July 10, 2026 09:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ulugbekna ulugbekna marked this pull request as draft July 10, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants