sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.55k stars 265 forks source link

Edit/Smart Apply: Correctly handle `add` insertion ranges #5185

Closed umpox closed 1 month ago

umpox commented 1 month ago

closes CODY-3243

Description

Initially reported here: https://sourcegraph.slack.com/archives/C05MW2TMYAV/p1723448811005809

Fixes a bug with Smart Apply where:

This uncovered two aspects that I've fixed here:

Test plan

  1. Create edits with the add intent, check that they appear correctly
  2. Create smart applies that add to the bottom of a file with a non-empty final line, check it appears correctly