From c7f81e8815b0e7a89af2ac74db3124dc40b91feb Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:44:48 +0530 Subject: [PATCH] fix tsc --- core/config/yaml/loadYaml.ts | 67 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 8765e6e98..9712db321 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -386,41 +386,42 @@ async function configYamlToContinueConfig(options: { const globalContext = new GlobalContext(); continueConfig.contextProviders = - config.context - ?.map((context) => { - const cls = contextProviderClassFromName(context.provider) as any; - if (!cls) { - if (!DEFAULT_CONTEXT_PROVIDERS_TITLES.includes(context.provider)) { - localErrors.push({ - fatal: false, - message: `Unknown context provider ${context.provider}`, - }); + ( + config.context + ?.map((context) => { + const cls = contextProviderClassFromName(context.provider) as any; + if (!cls) { + if (!DEFAULT_CONTEXT_PROVIDERS_TITLES.includes(context.provider)) { + localErrors.push({ + fatal: false, + message: `Unknown context provider ${context.provider}`, + }); + } + return undefined; } - return undefined; + const instance: IContextProvider = new cls({ + name: context.name, + ...context.params, + }); + return instance; + }) + .filter((p) => !!p) as IContextProvider[] + ).filter((p) => { + if (p.deprecationMessage) { + const providerTitle = p.description.title; + const shownWarnings = + globalContext.get("shownDeprecatedProviderWarnings") ?? {}; + if (!shownWarnings[providerTitle]) { + void ide.showToast("warning", p.deprecationMessage); + globalContext.update("shownDeprecatedProviderWarnings", { + ...shownWarnings, + [providerTitle]: true, + }); } - const instance: IContextProvider = new cls({ - name: context.name, - ...context.params, - }); - return instance; - }) - .filter((p) => !!p) - .filter((p) => { - if (p.deprecationMessage) { - const providerTitle = p.description.title; - const shownWarnings = - globalContext.get("shownDeprecatedProviderWarnings") ?? {}; - if (!shownWarnings[providerTitle]) { - void ide.showToast("warning", p.deprecationMessage); - globalContext.update("shownDeprecatedProviderWarnings", { - ...shownWarnings, - [providerTitle]: true, - }); - } - return true; - } - return false; - }) ?? []; + return true; + } + return false; + }) ?? []; continueConfig.contextProviders.push(...DEFAULT_CONTEXT_PROVIDERS);