Skip to content

Commit 954a673

Browse files
authored
Merge pull request #551 from devchat-ai/call_diff_event_to_gui
Refactor commands.ts to include MessageHandler for sending a codeDiffApply command
2 parents 8d8cb95 + 3209d88 commit 954a673

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/contributes/commands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { installRequirements } from '../util/python_installer/package_install';
1919
import { chatWithDevChat } from '../handler/chatHandler';
2020
import { focusDevChatInput } from '../handler/focusHandler';
2121
import { DevChatConfig } from '../util/config';
22+
import { MessageHandler } from "../handler/messageHandler";
2223

2324
const readdir = util.promisify(fs.readdir);
2425
const stat = util.promisify(fs.stat);
@@ -178,6 +179,10 @@ export function regApplyDiffResultCommand(context: vscode.ExtensionContext) {
178179

179180
// 保存左边文档
180181
await leftDoc.save();
182+
MessageHandler.sendMessage(
183+
ExtensionContextHolder.provider?.view()!,
184+
{ command: 'codeDiffApply', 'value': {} }
185+
);
181186
} else {
182187
vscode.window.showErrorMessage("No file to apply diff result.");
183188
}

0 commit comments

Comments
 (0)