Skip to content

Commit 34d2ec4

Browse files
authored
Pylance mcp tools can not be deselected (microsoft#254917)
1 parent 1ea38ea commit 34d2ec4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { assertNever } from '../../../../../base/common/assert.js';
66
import { Codicon } from '../../../../../base/common/codicons.js';
77
import { diffSets } from '../../../../../base/common/collections.js';
88
import { Event } from '../../../../../base/common/event.js';
9-
import { Iterable } from '../../../../../base/common/iterator.js';
109
import { DisposableStore } from '../../../../../base/common/lifecycle.js';
1110
import { ThemeIcon } from '../../../../../base/common/themables.js';
1211
import { assertType } from '../../../../../base/common/types.js';
@@ -391,10 +390,11 @@ export async function showToolsPicker(
391390
if (item.source.type === 'mcp') {
392391
mcpToolSets.add(item);
393392

394-
if (Iterable.every(item.getTools(), tool => result.get(tool))) {
393+
const toolsInSet = Array.from(item.getTools());
394+
if (toolsInSet.length && toolsInSet.every(tool => result.get(tool))) {
395395
// ALL tools from the MCP tool set are here, replace them with just the toolset
396396
// but only when computing the final result
397-
for (const tool of item.getTools()) {
397+
for (const tool of toolsInSet) {
398398
result.delete(tool);
399399
}
400400
result.set(item, true);

0 commit comments

Comments
 (0)