From 4cca689c94684e1ee3f6603f647dcfefd54ab60c Mon Sep 17 00:00:00 2001 From: Joaquin Coromina Date: Tue, 13 May 2025 22:24:32 -0400 Subject: [PATCH] Moved all watcher and file creation logic to initialize and fixed bug with this._configFileExists --- .../contrib/void/common/mcpConfigService.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/void/common/mcpConfigService.ts b/src/vs/workbench/contrib/void/common/mcpConfigService.ts index 7500302c..14698bd5 100644 --- a/src/vs/workbench/contrib/void/common/mcpConfigService.ts +++ b/src/vs/workbench/contrib/void/common/mcpConfigService.ts @@ -63,7 +63,8 @@ class MCPConfigService extends Disposable implements IMCPConfigService { const mcpConfigUri = await this._getMCPConfigPath(); // Check if the file exists - if (!this._configFileExists(mcpConfigUri)) { + const fileExists = await this._configFileExists(mcpConfigUri); + if (!fileExists) { // Create the file if it doesn't exist await this._createMCPConfigFile(mcpConfigUri); console.log('MCP Config file created:', mcpConfigUri.toString()); @@ -148,16 +149,13 @@ class MCPConfigService extends Disposable implements IMCPConfigService { // Get the MCP config file path const mcpConfigUri = await this._getMCPConfigPath(); - // Check if the file exists - if (!this._configFileExists(mcpConfigUri)) { - // Create the file if it doesn't exist - await this._createMCPConfigFile(mcpConfigUri); - console.log('MCP Config file created:', mcpConfigUri.toString()); - } - // Open the MCP config file in the editor await this.editorService.openEditor({ resource: mcpConfigUri, + options: { + pinned: true, + revealIfOpened: true, + } }); } catch (error) {