Skip to content

Commit

Permalink
Update the FixUp retry instruction text (#1615)
Browse files Browse the repository at this point in the history
The retry instruction text has the command attached, which recursively
adds to each retry. This PR fixes this issue that in case of any fixup
task, only the previous instruction is used/shown in the quick pick.

## Test plan

- Tested manually.

Before behaviour:


https://github.com/sourcegraph/cody/assets/44617923/70daecc9-bf38-4dd5-bca9-271367f4441c

After:


https://github.com/sourcegraph/cody/assets/44617923/1916df2e-b616-4f1c-96a6-c7144844759d

---------

Co-authored-by: Tom Ross <tom@umpox.com>
  • Loading branch information
deepak2431 and umpox committed Nov 6, 2023
1 parent b7f9a77 commit a057cf5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Starting from `0.2.0`, Cody is using `major.EVEN_NUMBER.patch` for release versi

### Fixed

- Fixup: Updated the fixup create task to just use the previous command text. [pull/1615](https://github.com/sourcegraph/cody/pull/1615)

### Changed

- Edit: Fixed formatting issues with some editor formatters that required explict indendation configuration. [pull/1620](https://github.com/sourcegraph/cody/pull/1620)
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/non-stop/FixupController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ export class FixupController
const document = await vscode.workspace.openTextDocument(task.fixupFile.uri)

// Prompt the user for a new instruction, and create a new fixup
const instruction = (await this.typingUI.getInstructionFromQuickPick({ value: previousInstruction })).trim()
const instruction = await this.typingUI.getInstructionFromQuickPick({ value: previousInstruction })

// Revert and remove the previous task
await this.undoTask(task)
Expand Down
1 change: 1 addition & 0 deletions vscode/src/non-stop/FixupTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class FixupTask {
public source?: ChatEventSource
) {
this.id = Date.now().toString(36).replaceAll(/\d+/g, '')
this.instruction = instruction.replace(/^\/edit/, '').trim()
}

/**
Expand Down

0 comments on commit a057cf5

Please sign in to comment.