MCPcopy Index your code
hub / github.com/continuedev/continue / loadConfig

Method loadConfig

extensions/cli/src/services/ConfigService.ts:253–307  ·  view source on GitHub ↗
(
    init: ConfigServiceInit,
  )

Source from the content-addressed store, hash-verified

251 }
252
253 private async loadConfig(
254 init: ConfigServiceInit,
255 ): Promise<ConfigServiceState> {
256 const {
257 authConfig,
258 configPath,
259 apiClient,
260 injectedConfigOptions,
261 agentFileState,
262 } = init;
263 const { injected, additional } = this.getAdditionalBlocksFromOptions(
264 injectedConfigOptions,
265 agentFileState,
266 );
267
268 const result = await loadConfiguration(
269 authConfig,
270 configPath,
271 apiClient,
272 injected,
273 init.isHeadless,
274 );
275
276 const loadedConfig = result.config;
277 const merged = mergeUnrolledAssistants(loadedConfig, additional);
278
279 const markdownRules = loadMarkdownRulesWithMetadata();
280 if (markdownRules.length > 0) {
281 const existingRuleContents = new Set(
282 (merged.rules ?? []).map((r) => (typeof r === "string" ? r : r?.rule)),
283 );
284 const newRules = markdownRules.filter(
285 (r) => !existingRuleContents.has(r.rule),
286 );
287 merged.rules = [...(merged.rules ?? []), ...newRules];
288 }
289
290 const withModel = await this.addDefaultChatModelIfNone(
291 merged,
292 apiClient,
293 authConfig,
294 init.isHeadless,
295 );
296
297 // Config URI persistence is now handled by the streamlined loader
298 logger.debug("ConfigService initialized successfully");
299
300 const state = {
301 config: withModel,
302 configPath,
303 };
304 this.setState(state);
305
306 return state;
307 }
308
309 /**
310 * Initialize the config service

Callers 15

doInitializeMethod · 0.95
switchConfigMethod · 0.95
updateConfigPathMethod · 0.95
streamInlineEditFunction · 0.45
getCommandsMapFunction · 0.45
getAutocompleteModelMethod · 0.45
getRerankModelMethod · 0.45
handleNonInstantDiffMethod · 0.45
QuickEditClass · 0.45
getCurModelMethod · 0.45
handleSelectMethod · 0.45

Calls 7

setStateMethod · 0.95
mergeUnrolledAssistantsFunction · 0.90
loadConfigurationFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected