diff options
| author | Leo <[email protected]> | 2025-06-12 02:21:54 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-11 18:21:54 -0700 |
| commit | 1ef68e061213b6b170bd979d31d4805da2357272 (patch) | |
| tree | ddd91ec2a7841e763676e09765adf6f21880c2c3 /packages/core/src/tools/edit.ts | |
| parent | dd53e5c96aa01708a3bdb675c8a8e0d71be35651 (diff) | |
feat: External editor settings (#882)
Diffstat (limited to 'packages/core/src/tools/edit.ts')
| -rw-r--r-- | packages/core/src/tools/edit.ts | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/packages/core/src/tools/edit.ts b/packages/core/src/tools/edit.ts index a49b8d83..39352121 100644 --- a/packages/core/src/tools/edit.ts +++ b/packages/core/src/tools/edit.ts @@ -432,19 +432,6 @@ Expectation for required parameters: } } - async getEditor(outcome: ToolConfirmationOutcome): Promise<EditorType> { - switch (outcome) { - case ToolConfirmationOutcome.ModifyVSCode: - return 'vscode'; - case ToolConfirmationOutcome.ModifyWindsurf: - return 'windsurf'; - case ToolConfirmationOutcome.ModifyCursor: - return 'cursor'; - default: - return 'vim'; - } - } - /** * Creates temp files for the current and proposed file contents and opens a diff tool. * When the diff tool is closed, the tool will check if the file has been modified and provide the updated params. @@ -453,7 +440,7 @@ Expectation for required parameters: async onModify( params: EditToolParams, _abortSignal: AbortSignal, - outcome: ToolConfirmationOutcome, + editorType: EditorType, ): Promise< { updatedParams: EditToolParams; updatedDiff: string } | undefined > { @@ -461,9 +448,7 @@ Expectation for required parameters: this.tempOldDiffPath = oldPath; this.tempNewDiffPath = newPath; - const editor = await this.getEditor(outcome); - - await openDiff(this.tempOldDiffPath, this.tempNewDiffPath, editor); + await openDiff(this.tempOldDiffPath, this.tempNewDiffPath, editorType); return await this.getUpdatedParamsIfModified(params, _abortSignal); } |
