From f969659e8b9680cea7e39854f5d8a9f45ca7d175 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:34:57 +0530 Subject: [PATCH] get the deprecation message from the provider itself --- core/config/yaml/loadYaml.ts | 7 ++----- core/context/index.ts | 4 ++-- core/context/providers/PostgresContextProvider.ts | 4 ++-- core/index.d.ts | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 051784056..9d9bee33e 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -417,15 +417,12 @@ async function configYamlToContinueConfig(options: { }) .filter((p) => !!p) .filter((p) => { - if (p.isDeprecated()) { + if (p.deprecationMessage) { const providerTitle = p.description.title; const shownWarnings = globalContext.get("shownDeprecatedProviderWarnings") ?? {}; if (!shownWarnings[providerTitle]) { - ide.showToast( - "warning", - `Context provider ${providerTitle} is deprecated and will be removed in a future version.`, - ); + ide.showToast("warning", p.deprecationMessage); globalContext.update("shownDeprecatedProviderWarnings", { ...shownWarnings, [providerTitle]: true, diff --git a/core/context/index.ts b/core/context/index.ts index c00d611aa..cde6b9440 100644 --- a/core/context/index.ts +++ b/core/context/index.ts @@ -32,7 +32,7 @@ export abstract class BaseContextProvider implements IContextProvider { return []; } - isDeprecated(): boolean { - return false; + get deprecationMessage(): string | null { + return null; } } diff --git a/core/context/providers/PostgresContextProvider.ts b/core/context/providers/PostgresContextProvider.ts index 70406e3d2..4f79c2e00 100644 --- a/core/context/providers/PostgresContextProvider.ts +++ b/core/context/providers/PostgresContextProvider.ts @@ -133,8 +133,8 @@ LIMIT ${sampleRows}`); } } - isDeprecated() { - return true; + get deprecationMessage() { + return "The Postgres context provider is deprecated. Please consider using the Postgres MCP (such as github.com/crystaldba/postgres-mcp) instead."; } } diff --git a/core/index.d.ts b/core/index.d.ts index b3524da73..1bbc21e2d 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -257,7 +257,7 @@ export interface IContextProvider { loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise; - isDeprecated(): boolean; + get deprecationMessage(): string | null; } export interface Session {