opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Swift module resolution fails in opencode edit tool, blocking edits

Open irffanasiff opened this issue 1 day ago • 2 comments

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

  1. Open an Xcode Swift project with internal Swift packages/frameworks.
  2. Use the edit or write tool on a Swift file that imports these modules.
  3. Observe diagnostics errors like:
    • ERROR [10:8] No such module 'Modulename'
    • ERROR [11:8] No such module 'Modulename'
  4. 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.

irffanasiff avatar Jan 13 '26 12:01 irffanasiff