MCPcopy Create free account
hub / github.com/continuedev/continue / doInitialize

Method doInitialize

extensions/cli/src/hooks/HookService.ts:44–69  ·  view source on GitHub ↗
(cwd?: string)

Source from the content-addressed store, hash-verified

42 }
43
44 async doInitialize(cwd?: string): Promise<HookServiceState> {
45 if (cwd) {
46 this.cwd = cwd;
47 }
48
49 const loaded = loadHooksConfig(this.cwd);
50
51 const eventCount = Object.keys(loaded.hooks).length;
52 const handlerCount = Object.values(loaded.hooks).reduce(
53 (sum, groups) =>
54 sum + (groups?.reduce((s, g) => s + g.hooks.length, 0) ?? 0),
55 0,
56 );
57
58 if (handlerCount > 0) {
59 logger.debug(
60 `Hooks loaded: ${handlerCount} handler(s) across ${eventCount} event type(s)`,
61 );
62 }
63
64 return {
65 config: loaded.hooks,
66 disabled: loaded.disabled,
67 onceKeys: new Set(),
68 };
69 }
70
71 /**
72 * Fire a hook event and return the aggregated result.

Callers 1

initializeMethod · 0.45

Calls 2

loadHooksConfigFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected