remove ask-code command

This commit is contained in:
bobo.yang 2023-11-22 17:43:27 +08:00
parent fab647c26d
commit 44e786ecce
3 changed files with 7 additions and 21 deletions

View File

@ -22,17 +22,6 @@ class CommandManager {
public static getInstance(): CommandManager {
if (!CommandManager.instance) {
CommandManager.instance = new CommandManager();
if (FT("ask-code")) {
CommandManager.instance.registerCommand({
name: 'ask-code',
pattern: 'ask-code',
description: 'Ask anything about your codebase and get answers from our AI agent',
args: 0,
handler: async (commandName: string, userInput: string) => {
return '';
}
});
}
}
return CommandManager.instance;

View File

@ -6,7 +6,7 @@ import { doCommit } from './doCommit';
import { historyMessages } from './historyMessages';
import { regCommandList, regCommandListByDevChatRun } from './regCommandList';
import { regContextList } from './regContextList';
import { sendMessage, stopDevChat, regeneration, deleteChatMessage, askCode } from './sendMessage';
import { sendMessage, stopDevChat, regeneration, deleteChatMessage, userInput } from './sendMessage';
import { blockApply } from './showDiff';
import { showDiff } from './showDiff';
import { addConext } from './addContext';
@ -83,7 +83,6 @@ messageHandler.registerHandler('applyAction', applyAction);
// Response: { command: 'deletedChatMessage', result: <message id> }
messageHandler.registerHandler('deleteChatMessage', deleteChatMessage);
messageHandler.registerHandler('askCode', askCode);
// Execute vscode command
// Response: none
messageHandler.registerHandler('doCommand', doCommand);
@ -96,4 +95,6 @@ messageHandler.registerHandler('featureToggles', featureToggles);
messageHandler.registerHandler('getUserAccessKey', getUserAccessKey);
messageHandler.registerHandler('regModelList', regModelList);
messageHandler.registerHandler('isDevChatInstalled', isDevChatInstalled);
messageHandler.registerHandler('isDevChatInstalled', isDevChatInstalled);
messageHandler.registerHandler('userInput', userInput);

View File

@ -36,6 +36,9 @@ export class MessageHandler {
if (messageObject && messageObject.user && messageObject.user === 'merico-devchat') {
message = messageObject;
isNeedSendResponse = true;
if (messageObject.hasResponse) {
isNeedSendResponse = false;
}
}
} catch (e) {
}
@ -53,13 +56,6 @@ export class MessageHandler {
if (message.text.indexOf('/autox') !== -1) {
autox = true;
}
// if "/ask-code" in message.text, then call devchat-ask to get result
if (FT("ask-code")) {
if (message.text.indexOf('/ask-code') !== -1) {
message.command = 'askCode';
message.text = message.text.replace('/ask-code', '');
}
}
}
const handler = this.handlers[message.command];