Merge pull request #551 from devchat-ai/call_diff_event_to_gui

Refactor commands.ts to include MessageHandler for sending a codeDiffApply command
This commit is contained in:
boob.yang 2024-06-07 17:25:04 +08:00 committed by GitHub
commit 954a67350e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ import { installRequirements } from '../util/python_installer/package_install';
import { chatWithDevChat } from '../handler/chatHandler';
import { focusDevChatInput } from '../handler/focusHandler';
import { DevChatConfig } from '../util/config';
import { MessageHandler } from "../handler/messageHandler";
const readdir = util.promisify(fs.readdir);
const stat = util.promisify(fs.stat);
@ -178,6 +179,10 @@ export function regApplyDiffResultCommand(context: vscode.ExtensionContext) {
// 保存左边文档
await leftDoc.save();
MessageHandler.sendMessage(
ExtensionContextHolder.provider?.view()!,
{ command: 'codeDiffApply', 'value': {} }
);
} else {
vscode.window.showErrorMessage("No file to apply diff result.");
}