get the deprecation message from the provider itself
This commit is contained in:
parent
b28d78ccc7
commit
f969659e8b
4 changed files with 7 additions and 10 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export abstract class BaseContextProvider implements IContextProvider {
|
|||
return [];
|
||||
}
|
||||
|
||||
isDeprecated(): boolean {
|
||||
return false;
|
||||
get deprecationMessage(): string | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
2
core/index.d.ts
vendored
|
|
@ -257,7 +257,7 @@ export interface IContextProvider {
|
|||
|
||||
loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise<ContextSubmenuItem[]>;
|
||||
|
||||
isDeprecated(): boolean;
|
||||
get deprecationMessage(): string | null;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue