Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/pkg/mcp/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,11 @@ func handleVSCodeConfig(configPath string) error {

// Check if the file exists
if data, err := os.ReadFile(configPath); err == nil {
// File exists, parse it
if err := json.Unmarshal(data, &existingData); err != nil {
return fmt.Errorf("failed to unmarshal existing vscode config %w", err)
if string(data) != "" {
// File exists and is not empty, try to parse it
if err := json.Unmarshal(data, &existingData); err != nil {
return fmt.Errorf("failed to unmarshal existing vscode config %w", err)
}
}

// Check if "servers" section exists
Expand Down
Loading