Commit 69b73b7
authored
mcp: fix start all servers command (#286624)
* mcp: fix start all servers command
If user specified `undefined` as the `serverId`
```
await vscode.commands.executeCommand('workbench.mcp.startServer', undefined);
```
…it would be turned into `null` when passed through the command system
and was therefore not being treated as a wildcard.
Resolves #283959.
* mcp: fix start all servers command
Resolves #283959.
Previous implementation looked strictly for `undefined`, but the IPC layer
converts `undefined` to `null`. This meant that calling the command via IPC
like:
```
await vscode.commands.executeCommand('workbench.mcp.startServer', undefined);
```
was not working (while `vscode.commands.executeCommand('workbench.mcp.startServer')` was).
Instead of handling `null` as a value as well, use a specicial value of `*`
to indicate all servers should be started so the intent is clearer:
```
BEFORE: await vscode.commands.executeCommand('workbench.mcp.startServer');
AFTER : await vscode.commands.executeCommand('workbench.mcp.startServer', '*');
```
Additionally, add a `waitForLiveTools` parameter that blocks the command
from resolving until the server is downloaded, started, and tools are availble.
Without this, a static sleep or poll would be needed.1 parent dea178a commit 69b73b7
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
821 | 822 | | |
822 | 823 | | |
823 | 824 | | |
824 | | - | |
| 825 | + | |
825 | 826 | | |
826 | | - | |
| 827 | + | |
827 | 828 | | |
828 | 829 | | |
829 | 830 | | |
830 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
831 | 837 | | |
832 | 838 | | |
833 | 839 | | |
| |||
0 commit comments