add regeneration message
This commit is contained in:
parent
42fec8a6cc
commit
daf106c629
@ -6,7 +6,7 @@ import { doCommit } from './doCommit';
|
|||||||
import { historyMessages } from './historyMessages';
|
import { historyMessages } from './historyMessages';
|
||||||
import { regCommandList } from './regCommandList';
|
import { regCommandList } from './regCommandList';
|
||||||
import { regContextList } from './regContextList';
|
import { regContextList } from './regContextList';
|
||||||
import { sendMessage, stopDevChat } from './sendMessage';
|
import { sendMessage, stopDevChat, regeneration } from './sendMessage';
|
||||||
import { blockApply } from './showDiff';
|
import { blockApply } from './showDiff';
|
||||||
import { showDiff } from './showDiff';
|
import { showDiff } from './showDiff';
|
||||||
import { addConext } from './addContext';
|
import { addConext } from './addContext';
|
||||||
@ -64,4 +64,6 @@ messageHandler.registerHandler('addRefCommandContext', addRefCommandContext);
|
|||||||
messageHandler.registerHandler('contextDetail', contextDetail);
|
messageHandler.registerHandler('contextDetail', contextDetail);
|
||||||
// Debug handler
|
// Debug handler
|
||||||
messageHandler.registerHandler('listAllMessages', listAllMessages);
|
messageHandler.registerHandler('listAllMessages', listAllMessages);
|
||||||
|
// regeneration
|
||||||
|
// 应答与sendMessage相同
|
||||||
|
messageHandler.registerHandler('regeneration', regeneration);
|
||||||
|
@ -10,6 +10,7 @@ import messageHistory from '../util/messageHistory';
|
|||||||
import CustomCommands from '../command/customCommand';
|
import CustomCommands from '../command/customCommand';
|
||||||
import { regInMessage, regOutMessage } from '../util/reg_messages';
|
import { regInMessage, regOutMessage } from '../util/reg_messages';
|
||||||
|
|
||||||
|
let _lastMessage: any = undefined;
|
||||||
|
|
||||||
|
|
||||||
// Add this function to messageHandler.ts
|
// Add this function to messageHandler.ts
|
||||||
@ -77,6 +78,8 @@ regOutMessage({ command: 'receiveMessagePartial', text: 'xxxx', user: 'xxx', dat
|
|||||||
// { command: 'receiveMessage', text: 'xxxx', hash: 'xxx', user: 'xxx', date: 'xxx'}
|
// { command: 'receiveMessage', text: 'xxxx', hash: 'xxx', user: 'xxx', date: 'xxx'}
|
||||||
// { command: 'receiveMessagePartial', text: 'xxxx', user: 'xxx', date: 'xxx'}
|
// { command: 'receiveMessagePartial', text: 'xxxx', user: 'xxx', date: 'xxx'}
|
||||||
export async function sendMessage(message: any, panel: vscode.WebviewPanel|vscode.WebviewView): Promise<void> {
|
export async function sendMessage(message: any, panel: vscode.WebviewPanel|vscode.WebviewView): Promise<void> {
|
||||||
|
_lastMessage = message;
|
||||||
|
|
||||||
const newText2 = await CommandManager.getInstance().processText(message.text);
|
const newText2 = await CommandManager.getInstance().processText(message.text);
|
||||||
const parsedMessage = parseMessage(newText2);
|
const parsedMessage = parseMessage(newText2);
|
||||||
const chatOptions: any = {};
|
const chatOptions: any = {};
|
||||||
@ -131,6 +134,15 @@ export async function sendMessage(message: any, panel: vscode.WebviewPanel|vscod
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// regeneration last message again
|
||||||
|
regInMessage({command: 'regeneration'});
|
||||||
|
export async function regeneration(message: any, panel: vscode.WebviewPanel|vscode.WebviewView): Promise<void> {
|
||||||
|
// call sendMessage to send last message again
|
||||||
|
if (_lastMessage) {
|
||||||
|
sendMessage(_lastMessage, panel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
regInMessage({command: 'stopDevChat'});
|
regInMessage({command: 'stopDevChat'});
|
||||||
export async function stopDevChat(message: any, panel: vscode.WebviewPanel|vscode.WebviewView): Promise<void> {
|
export async function stopDevChat(message: any, panel: vscode.WebviewPanel|vscode.WebviewView): Promise<void> {
|
||||||
logger.channel()?.info(`Stopping devchat`);
|
logger.channel()?.info(`Stopping devchat`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user