MCPcopy
hub / github.com/continuedev/continue / initialize

Function initialize

extensions/cli/src/services/BaseService.test.ts:31–55  ·  view source on GitHub ↗

* Public initialization method that wraps the implementation

(...args: any[])

Source from the content-addressed store, hash-verified

29 * Public initialization method that wraps the implementation
30 */
31 async initialize(...args: any[]): Promise<TState> {
32 logger.debug(`Initializing ${this.serviceName}`, {
33 wasInitialized: this.isInitialized,
34 hadPreviousState: !!this.currentState,
35 });
36 this.emit("initializing");
37
38 try {
39 const state = await this.doInitialize(...args);
40 this.currentState = state;
41 this.isInitialized = true;
42 logger.debug(`${this.serviceName} initialized successfully`, {
43 stateKeys: state ? Object.keys(state as any) : [],
44 isNowInitialized: this.isInitialized,
45 });
46 this.emit("initialized", state);
47 return state;
48 } catch (error: any) {
49 logger.debug(`Failed to initialize ${this.serviceName}:`, error);
50 if (this.listenerCount("error") > 0) {
51 this.emit("error", error);
52 }
53 throw error;
54 }
55 }
56
57 /**
58 * Get current service state (shallow copy for immutability)

Callers

nothing calls this directly

Calls 3

emitMethod · 0.65
debugMethod · 0.45
doInitializeMethod · 0.45

Tested by

no test coverage detected