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

Function doLoadConfig

core/config/profile/doLoadConfig.ts:64–364  ·  view source on GitHub ↗
(options: {
  ide: IDE;
  llmLogger: ILLMLogger;
  overrideConfigJson?: SerializedContinueConfig;
  overrideConfigYaml?: AssistantUnrolled;
  profileId: string;
  overrideConfigYamlByPath?: string;
  packageIdentifier: PackageIdentifier;
})

Source from the content-addressed store, hash-verified

62}
63
64export default async function doLoadConfig(options: {
65 ide: IDE;
66 llmLogger: ILLMLogger;
67 overrideConfigJson?: SerializedContinueConfig;
68 overrideConfigYaml?: AssistantUnrolled;
69 profileId: string;
70 overrideConfigYamlByPath?: string;
71 packageIdentifier: PackageIdentifier;
72}): Promise<ConfigResult<ContinueConfig>> {
73 const {
74 ide,
75 llmLogger,
76 overrideConfigJson,
77 overrideConfigYaml,
78 profileId,
79 overrideConfigYamlByPath,
80 packageIdentifier,
81 } = options;
82
83 const ideInfo = await ide.getIdeInfo();
84 const uniqueId = await ide.getUniqueId();
85 const ideSettings = await ide.getIdeSettings();
86
87 // Migrations for old config files
88 // Removes
89 const configJsonPath = getConfigJsonPath();
90 if (fs.existsSync(configJsonPath)) {
91 migrateJsonSharedConfig(configJsonPath, ide);
92 }
93
94 const configYamlPath = localPathOrUriToPath(
95 overrideConfigYamlByPath || getConfigYamlPath(ideInfo.ideType),
96 );
97
98 let newConfig: ContinueConfig | undefined;
99 let errors: ConfigValidationError[] | undefined;
100 let configLoadInterrupted = false;
101 let configName: string | undefined;
102
103 const hasPreReadContent =
104 packageIdentifier.uriType === "file" &&
105 packageIdentifier.content !== undefined;
106
107 if (
108 overrideConfigYaml ||
109 hasPreReadContent ||
110 fs.existsSync(configYamlPath)
111 ) {
112 const result = await loadContinueConfigFromYaml({
113 ide,
114 ideSettings,
115 ideInfo,
116 uniqueId,
117 llmLogger,
118 overrideConfigYaml,
119 packageIdentifier,
120 });
121 newConfig = result.config;

Callers 2

doLoadConfigMethod · 0.85

Calls 15

getMethod · 0.95
updateMethod · 0.95
getConfigJsonPathFunction · 0.90
migrateJsonSharedConfigFunction · 0.90
localPathOrUriToPathFunction · 0.90
getConfigYamlPathFunction · 0.90
getMCPToolNameFunction · 0.90
encodeMCPToolUriFunction · 0.90

Tested by

no test coverage detected