bobo.yang e2e761fd16 Separate handling for OpenAI and DevChat API keys
- Renamed and split the API key settings in package.json into DevChat and OpenAI specific keys.
- Updated the commands for setting API keys to handle OpenAI and DevChat keys separately.
- Modified the ApiKeyManager to handle and validate OpenAI and DevChat keys separately.
- Updated the status bar view to use the DevChat access key command.
- Adjusted the tests to reflect the new handling of API keys.
2023-08-03 15:09:34 +08:00

61 lines
1.7 KiB
TypeScript

import * as vscode from 'vscode';
import {
registerOpenChatPanelCommand,
registerAddContextCommand,
registerAskForCodeCommand,
registerAskForFileCommand,
registerOpenAiApiKeySettingCommand,
registerDevChatApiKeySettingCommand,
regTopicDeleteCommand,
regAddTopicCommand,
regDeleteSelectTopicCommand,
regSelectTopicCommand,
regReloadTopicCommand,
regApplyDiffResultCommand,
registerStatusBarItemClickCommand,
regPythonPathCommand,
} from './contributes/commands';
import { regLanguageContext } from './contributes/context';
import { regDevChatView, regTopicView } from './contributes/views';
import ExtensionContextHolder from './util/extensionContext';
import { logger } from './util/logger';
import { LoggerChannelVscode } from './util/logger_vscode';
import { createStatusBarItem } from './panel/statusBarView';
import { UiUtilWrapper } from './util/uiUtil';
import { UiUtilVscode } from './util/uiUtil_vscode';
function activate(context: vscode.ExtensionContext) {
ExtensionContextHolder.context = context;
logger.init(LoggerChannelVscode.getInstance());
UiUtilWrapper.init(new UiUtilVscode());
regLanguageContext();
regDevChatView(context);
regTopicView(context);
registerOpenAiApiKeySettingCommand(context);
registerDevChatApiKeySettingCommand(context);
registerOpenChatPanelCommand(context);
registerAddContextCommand(context);
registerAskForCodeCommand(context);
registerAskForFileCommand(context);
registerStatusBarItemClickCommand(context);
createStatusBarItem(context);
regTopicDeleteCommand(context);
regAddTopicCommand(context);
regDeleteSelectTopicCommand(context);
regSelectTopicCommand(context);
regReloadTopicCommand(context);
regApplyDiffResultCommand(context);
regPythonPathCommand(context);
}
exports.activate = activate;