Skip to content

Commit a37f771

Browse files
authored
mcp: fix unhelpful error case and picker opens and closes (microsoft#259914)
Fixes microsoft#259495
1 parent 27c6eff commit a37f771

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ export class MCPServerActionRendering extends Disposable implements IWorkbenchCo
494494
} else if (state === DisplayedState.Error) {
495495
const server = findLast(servers, isServer);
496496
if (server) {
497-
server.showOutput();
497+
await server.showOutput(true);
498498
commandService.executeCommand(McpCommandIds.ServerOptions, server.definition.id);
499499
}
500500
} else {

src/vs/workbench/contrib/mcp/common/mcpServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ export class McpServer extends Disposable implements IMcpServer {
450450
return this._fullDefinitions;
451451
}
452452

453-
public showOutput(): void {
453+
public showOutput(preserveFocus?: boolean) {
454454
this._loggerService.setVisibility(this._loggerId, true);
455-
this._outputService.showChannel(this._loggerId);
455+
return this._outputService.showChannel(this._loggerId, preserveFocus);
456456
}
457457

458458
public resources(token?: CancellationToken): AsyncIterable<IMcpResource[]> {

src/vs/workbench/contrib/mcp/common/mcpTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export interface IMcpServer extends IDisposable {
288288
*/
289289
readDefinitions(): IObservable<{ server: McpServerDefinition | undefined; collection: McpCollectionDefinition | undefined }>;
290290

291-
showOutput(): void;
291+
showOutput(preserveFocus?: boolean): Promise<void>;
292292
/**
293293
* Starts the server and returns its resulting state. One of:
294294
* - Running, if all good

0 commit comments

Comments
 (0)