Skip to content

Commit 985f0a5

Browse files
authored
mcp: remove optimistic initial resource completions (microsoft#250321)
Now that we publish , this is not something we should do in advance.
1 parent 00e6a9c commit 985f0a5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,10 @@ export class McpResourcePickHelper {
125125
quickInput.totalSteps = todo.length;
126126
quickInput.ignoreFocusOut = true;
127127

128-
const initialCompletions = todo.map(variable => rt.complete(variable.name, '', {}, cts.token));
129-
130128
try {
131129
for (let i = 0; i < todo.length; i++) {
132130
const variable = todo[i];
133-
const resolved = await this._promptForTemplateValue(quickInput, variable, initialCompletions[i], vars, rt);
131+
const resolved = await this._promptForTemplateValue(quickInput, variable, vars, rt);
134132
if (resolved === undefined) {
135133
return undefined;
136134
}
@@ -143,9 +141,9 @@ export class McpResourcePickHelper {
143141
}
144142
}
145143

146-
private _promptForTemplateValue(input: IQuickPick<IQuickPickItem>, variable: IUriTemplateVariable, initialCompletions: Promise<string[]>, variablesSoFar: Record<string, string | string[]>, rt: IMcpResourceTemplate): Promise<string | undefined> {
144+
private _promptForTemplateValue(input: IQuickPick<IQuickPickItem>, variable: IUriTemplateVariable, variablesSoFar: Record<string, string | string[]>, rt: IMcpResourceTemplate): Promise<string | undefined> {
147145
const store = new DisposableStore();
148-
const completions = new Map<string, Promise<string[]>>([['', initialCompletions]]);
146+
const completions = new Map<string, Promise<string[]>>([]);
149147

150148
const variablesWithPlaceholders = { ...variablesSoFar };
151149
for (const variable of rt.template.components.flatMap(c => typeof c === 'object' ? c.variables : [])) {

0 commit comments

Comments
 (0)