opencode
opencode copied to clipboard
Swift module resolution fails in opencode edit tool, blocking edits
Description
Summary
When using OpenCode in a Swift/Xcode workspace with internal Swift packages, the edit tool refuses to apply changes. It runs diagnostics that can't resolve these local modules. The project builds fine in Xcode, but OpenCode's diagnostics fail and block all edits.
Steps to Reproduce
- Open an Xcode Swift project with internal Swift packages/frameworks.
- Use the edit or write tool on a Swift file that imports these modules.
- Observe diagnostics errors like:
ERROR [10:8] No such module 'Modulename'ERROR [11:8] No such module 'Modulename'
- Edits are rejected even though the project compiles successfully in Xcode.
Expected Behavior
The edit tool should allow changes without requiring module resolution, or it should resolve modules using the project's Xcode build settings.
Actual Behavior
Edits are blocked due to diagnostics in OpenCode’s environment.
Notes
This seems like a false negative because OpenCode doesn’t load Xcode build configurations or package dependencies. This makes it impossible to apply Swift edits in otherwise valid projects.