2023-05-04 07:27:26 +08:00
|
|
|
import * as vscode from 'vscode';
|
2023-05-10 18:30:17 +08:00
|
|
|
|
2023-05-05 21:27:40 +08:00
|
|
|
import {
|
2023-08-21 11:52:00 +08:00
|
|
|
registerOpenChatPanelCommand,
|
|
|
|
registerAddContextCommand,
|
|
|
|
registerAskForCodeCommand,
|
|
|
|
registerAskForFileCommand,
|
|
|
|
registerOpenAiApiKeySettingCommand,
|
|
|
|
registerDevChatApiKeySettingCommand,
|
|
|
|
regTopicDeleteCommand,
|
|
|
|
regAddTopicCommand,
|
|
|
|
regDeleteSelectTopicCommand,
|
|
|
|
regSelectTopicCommand,
|
|
|
|
regReloadTopicCommand,
|
|
|
|
regApplyDiffResultCommand,
|
|
|
|
registerStatusBarItemClickCommand,
|
|
|
|
regPythonPathCommand,
|
|
|
|
registerAskCodeIndexStartCommand,
|
2023-08-21 11:52:00 +08:00
|
|
|
registerAskCodeIndexStopCommand,
|
2023-08-21 11:52:00 +08:00
|
|
|
registerAskCodeSummaryIndexStartCommand,
|
|
|
|
registerAskCodeSummaryIndexStopCommand,
|
|
|
|
registerAddSummaryContextCommand,
|
2023-05-05 21:27:40 +08:00
|
|
|
} from './contributes/commands';
|
2023-05-31 16:10:53 +08:00
|
|
|
import { regLanguageContext } from './contributes/context';
|
|
|
|
import { regDevChatView, regTopicView } from './contributes/views';
|
2023-04-27 14:07:46 +08:00
|
|
|
|
2023-05-05 21:27:40 +08:00
|
|
|
import ExtensionContextHolder from './util/extensionContext';
|
2023-05-09 08:52:07 +08:00
|
|
|
import { logger } from './util/logger';
|
2023-05-31 16:10:53 +08:00
|
|
|
import { LoggerChannelVscode } from './util/logger_vscode';
|
2023-08-21 11:52:00 +08:00
|
|
|
import { createStatusBarItem, createAskCodeStatusBarItem } from './panel/statusBarView';
|
2023-05-31 16:10:53 +08:00
|
|
|
import { UiUtilWrapper } from './util/uiUtil';
|
|
|
|
import { UiUtilVscode } from './util/uiUtil_vscode';
|
2023-08-24 10:45:51 +08:00
|
|
|
import { FT } from './util/feature_flags/feature_toggles';
|
2023-05-19 20:07:34 +08:00
|
|
|
|
2023-05-04 11:50:45 +08:00
|
|
|
|
2023-05-04 07:27:26 +08:00
|
|
|
function activate(context: vscode.ExtensionContext) {
|
2023-08-21 11:52:00 +08:00
|
|
|
ExtensionContextHolder.context = context;
|
2023-05-31 16:10:53 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
logger.init(LoggerChannelVscode.getInstance());
|
|
|
|
UiUtilWrapper.init(new UiUtilVscode());
|
2023-05-04 11:50:45 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
regLanguageContext();
|
2023-05-16 10:40:57 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
regDevChatView(context);
|
|
|
|
regTopicView(context);
|
2023-05-16 10:40:57 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
registerOpenAiApiKeySettingCommand(context);
|
|
|
|
registerDevChatApiKeySettingCommand(context);
|
|
|
|
registerOpenChatPanelCommand(context);
|
|
|
|
registerAddContextCommand(context);
|
|
|
|
registerAskForCodeCommand(context);
|
|
|
|
registerAskForFileCommand(context);
|
|
|
|
registerStatusBarItemClickCommand(context);
|
2023-05-16 14:24:24 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
createStatusBarItem(context);
|
2023-08-24 10:45:51 +08:00
|
|
|
if (FT("ask-code")) {
|
|
|
|
createAskCodeStatusBarItem(context);
|
|
|
|
}
|
2023-05-18 15:25:46 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
regTopicDeleteCommand(context);
|
|
|
|
regAddTopicCommand(context);
|
|
|
|
regDeleteSelectTopicCommand(context);
|
|
|
|
regSelectTopicCommand(context);
|
|
|
|
regReloadTopicCommand(context);
|
|
|
|
regApplyDiffResultCommand(context);
|
2023-07-06 07:42:44 +08:00
|
|
|
|
2023-08-21 11:52:00 +08:00
|
|
|
regPythonPathCommand(context);
|
2023-08-24 10:45:51 +08:00
|
|
|
|
|
|
|
registerAskCodeIndexStartCommand(context);
|
|
|
|
registerAskCodeIndexStopCommand(context);
|
|
|
|
|
|
|
|
registerAskCodeSummaryIndexStartCommand(context);
|
|
|
|
registerAskCodeSummaryIndexStopCommand(context);
|
2023-08-21 11:52:00 +08:00
|
|
|
registerAddSummaryContextCommand(context);
|
2023-04-14 08:05:41 +08:00
|
|
|
}
|
2023-08-21 11:52:00 +08:00
|
|
|
exports.activate = activate;
|