Skip to content

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

@irffanasiff

Description

@irffanasiff

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions