fix: Ensure devchat subprocesses terminate on IDE close

- Added a deactivate function to handle IDE shutdown events
- Utilize stopDevChatBase to terminate devchat subprocesses
- Included necessary import for the constants module
This commit is contained in:
bobo.yang 2024-02-09 09:54:03 +08:00
parent dc58a93bed
commit 2e607f3bad

View File

@ -27,6 +27,8 @@ import { UiUtilVscode } from './util/uiUtil_vscode';
import { ApiKeyManager } from './util/apiKey';
import { startRpcServer } from './ide_services/services';
import { registerCodeLensProvider } from './panel/codeLens';
import { stopDevChatBase } from './handler/sendMessageBase';
import exp from 'constants';
async function isProviderHasSetted() {
try {
@ -362,4 +364,10 @@ async function activate(context: vscode.ExtensionContext) {
logger.channel()?.info(`registerHandleUri:`);
registerHandleUri(context)
}
exports.activate = activate;
async function deactivate() {
// stop devchat
await stopDevChatBase({});
}
exports.activate = activate;
exports.deactivate = deactivate;