Swift module resolution fails in opencode edit tool, blocking edits #5295

Open
opened 2026-02-16 17:51:01 -05:00 by yindo · 0 comments
Owner

Originally created by @irffanasiff on GitHub (Jan 13, 2026).

Originally assigned to: @thdxr on GitHub.

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.

Originally created by @irffanasiff on GitHub (Jan 13, 2026). Originally assigned to: @thdxr on GitHub. ### 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.
yindo added the bug label 2026-02-16 17:51:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5295