Skip to content

Conversation

@cursor
Copy link
Contributor

@cursor cursor bot commented Jan 21, 2026

Replaces Kotlin's val keyword with Swift's let in scaffolded Swift files to prevent compilation errors. Fixes XCODEBUILD-MCP-132X.


Open in Cursor Open in Web


Note

Ensures scaffolded Swift sources compile by correcting Kotlin-style val to Swift let.

  • Adds fixSwiftSyntax applied to .swift files in scaffold_ios_project.ts and scaffold_macos_project.ts
  • Introduces tests validating single and multiple replacements in iOS scaffolding
  • Updates CHANGELOG.md with the fix reference (XCODEBUILD-MCP-132X)

Written by Cursor Bugbot for commit debd3f2. This will update automatically on new commits. Configure here.

Replace Kotlin 'val' keyword with Swift 'let' during template processing.
This prevents compilation errors when scaffolding iOS/macOS projects.

- Added fixSwiftSyntax() to convert 'val' to 'let' in Swift files
- Applied fix to both iOS and macOS scaffold processing
- Added tests to verify the fix works correctly
- Updated CHANGELOG.md

Fixes XCODEBUILD-MCP-132X
@cursor
Copy link
Contributor Author

cursor bot commented Jan 21, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cameroncooke/XcodeBuildMCP/xcodebuildmcp@181

commit: debd3f2

@cameroncooke cameroncooke marked this pull request as ready for review January 21, 2026 12:02
Copy link
Contributor Author

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

result = result.replace(/\bval\s+(\w+)\s*=/g, 'let $1 =');

return result;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated fixSwiftSyntax function across scaffolding files

Low Severity

The fixSwiftSyntax function is duplicated identically in both scaffold_ios_project.ts and scaffold_macos_project.ts. Both implementations contain the same regex replacement logic (/\bval\s+(\w+)\s*=/glet $1 =). This duplication increases maintenance burden and risks inconsistent bug fixes if the logic needs to be updated in the future—a fix applied to one file might be forgotten in the other.

Additional Locations (1)

Fix in Cursor Fix in Web

// Apply Swift syntax fixes if this is a Swift file
if (isSwiftFile) {
processedContent = fixSwiftSyntax(processedContent);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swift syntax fix skipped when customizeNames is false

Low Severity

The fixSwiftSyntax call is inside the if (isTextFile && customizeNames) block. When a user scaffolds with customizeNames: false, Swift files are copied via cp in the else branch, completely bypassing the syntax fix. This means the Kotlin val syntax error would persist in the output files, defeating the purpose of the fix ("prevent compilation errors") for users who explicitly set customizeNames: false.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants