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.71k stars 297 forks source link

Edit: Correctly guard against duplicate in-progress edits #5183

Closed umpox closed 2 months ago

umpox commented 2 months ago

Description

Edit instruction is no longer a string, but a PromptString object.

This meant that our equality check failed, the two strings were identical, but not considered the same due to how object equality works in JS

Test plan

  1. Select some code
  2. Open the Cody sidebar
  3. Hit "Document Code" or "Generate Unit Test" multiple times
  4. Confirm that only one "Document Code" or "Generate Unit Test" command runs