get the deprecation message from the provider itself

This commit is contained in:
uinstinct 2025-07-24 20:34:57 +05:30
parent b28d78ccc7
commit f969659e8b
4 changed files with 7 additions and 10 deletions

View file

@ -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,

View file

@ -32,7 +32,7 @@ export abstract class BaseContextProvider implements IContextProvider {
return [];
}
isDeprecated(): boolean {
return false;
get deprecationMessage(): string | null {
return null;
}
}

View file

@ -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.";
}
}

2
core/index.d.ts vendored
View file

@ -257,7 +257,7 @@ export interface IContextProvider {
loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise<ContextSubmenuItem[]>;
isDeprecated(): boolean;
get deprecationMessage(): string | null;
}
export interface Session {