mirror of
https://github.com/voideditor/void
synced 2026-05-23 17:38:23 +00:00
Moved all watcher and file creation logic to initialize and fixed bug with this._configFileExists
This commit is contained in:
parent
63083cec89
commit
4cca689c94
1 changed files with 6 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue