mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: External editor settings (#882)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user