feat: Add local service management
- Implement start and stop functionality for local service - Register new command to start local service - Add error handling for local service shutdown
This commit is contained in:
parent
a44af269ce
commit
3fa139ff91
@ -16,6 +16,7 @@ import {
|
|||||||
registerFixCommand,
|
registerFixCommand,
|
||||||
registerExplainCommand,
|
registerExplainCommand,
|
||||||
registerQuickFixCommand,
|
registerQuickFixCommand,
|
||||||
|
registerStartLocalServiceCommand
|
||||||
} from './contributes/commands';
|
} from './contributes/commands';
|
||||||
import { regLanguageContext } from './contributes/context';
|
import { regLanguageContext } from './contributes/context';
|
||||||
import { regDevChatView } from './contributes/views';
|
import { regDevChatView } from './contributes/views';
|
||||||
@ -33,6 +34,7 @@ import { DevChatConfig } from './util/config';
|
|||||||
import { InlineCompletionProvider, registerCodeCompleteCallbackCommand } from "./contributes/codecomplete/codecomplete";
|
import { InlineCompletionProvider, registerCodeCompleteCallbackCommand } from "./contributes/codecomplete/codecomplete";
|
||||||
import { indexDir } from "./contributes/codecomplete/astIndex";
|
import { indexDir } from "./contributes/codecomplete/astIndex";
|
||||||
import registerQuickFixProvider from "./contributes/quickFixProvider";
|
import registerQuickFixProvider from "./contributes/quickFixProvider";
|
||||||
|
import { stopLocalService } from './util/localService';
|
||||||
|
|
||||||
|
|
||||||
async function migrateConfig() {
|
async function migrateConfig() {
|
||||||
@ -152,6 +154,7 @@ async function activate(context: vscode.ExtensionContext) {
|
|||||||
registerStatusBarItemClickCommand(context);
|
registerStatusBarItemClickCommand(context);
|
||||||
|
|
||||||
registerInstallCommandsCommand(context);
|
registerInstallCommandsCommand(context);
|
||||||
|
registerStartLocalServiceCommand(context);
|
||||||
|
|
||||||
createStatusBarItem(context);
|
createStatusBarItem(context);
|
||||||
|
|
||||||
@ -178,6 +181,13 @@ async function activate(context: vscode.ExtensionContext) {
|
|||||||
async function deactivate() {
|
async function deactivate() {
|
||||||
// stop devchat
|
// stop devchat
|
||||||
await stopDevChatBase({});
|
await stopDevChatBase({});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await stopLocalService();
|
||||||
|
logger.channel()?.info('Local service stopped successfully');
|
||||||
|
} catch (error) {
|
||||||
|
logger.channel()?.error('Error stopping local service:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.activate = activate;
|
exports.activate = activate;
|
||||||
exports.deactivate = deactivate;
|
exports.deactivate = deactivate;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user