Skip to content

nes: refactor: simplify toInlineSuggestion#311461

Merged
ulugbekna merged 2 commits intomainfrom
ulugbekna/sacred-haddock
Apr 20, 2026
Merged

nes: refactor: simplify toInlineSuggestion#311461
ulugbekna merged 2 commits intomainfrom
ulugbekna/sacred-haddock

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

Co-authored-by: Copilot copilot@github.com

Copilot AI review requested due to automatic review settings April 20, 2026 19:09
@ulugbekna ulugbekna enabled auto-merge (rebase) April 20, 2026 19:09
@ulugbekna ulugbekna self-assigned this Apr 20, 2026
@ulugbekna ulugbekna force-pushed the ulugbekna/sacred-haddock branch from 32c963b to 4c4a822 Compare April 20, 2026 19:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors toInlineSuggestion in the Copilot inline-edits VS Code node implementation to simplify the logic for determining when edits can be represented as same-line ghost text, while preserving behavior via updated/expanded tests.

Changes:

  • Extracted next-line insertion handling, multi-line prefix stripping, and same-line validation into helper functions.
  • Adjusted next-line insertion rewriting to drop a trailing line ending (CRLF-safe) to avoid introducing a blank line.
  • Updated and extended unit tests, including additional CRLF and regression coverage.
Show a summary per file
File Description
extensions/copilot/src/extension/inlineEdits/vscode-node/isInlineSuggestion.ts Refactors toInlineSuggestion into smaller helpers and adjusts next-line insertion rewriting behavior.
extensions/copilot/src/extension/inlineEdits/test/vscode-node/isInlineSuggestion.spec.ts Updates existing assertions and adds new test cases for trailing newline trimming, CRLF behavior, and a regression scenario.

Copilot's findings

  • Files reviewed: 52/52 changed files
  • Comments generated: 1

Comment thread extensions/copilot/src/extension/inlineEdits/vscode-node/isInlineSuggestion.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 7f7a471f Current: 51f1ada9

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after

DonJayamanne
DonJayamanne previously approved these changes Apr 20, 2026
ulugbekna and others added 2 commits April 20, 2026 23:44
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@ulugbekna ulugbekna merged commit bc3fee1 into main Apr 20, 2026
26 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/sacred-haddock branch April 20, 2026 22:06
@vs-code-engineering vs-code-engineering bot added this to the 1.118.0 milestone Apr 20, 2026
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.

4 participants