CodeEditApp / CodeEdit

📝 CodeEdit App for macOS – Elevate your code editing experience. Open source, free forever.
https://codeedit.app
MIT License
21.16k stars 1.02k forks source link

Fix Initialization, Actor Isolation, and `Package.resolved` Issues #1847

Closed mhh-azam closed 3 months ago

mhh-azam commented 3 months ago

Description

This PR addresses the following issues:

  1. Fix for Self Initialization Before Use:

    • Initialize displayName property before accessing self in the initializer.
    • This resolves errors related to accessing uninitialized properties.
  2. Fix for Using Weak Self to Avoid Actor-Isolated Property Issue:

    • Capture self weakly in the MainActor.run block to prevent issues with actor isolation.
    • Avoids the error caused by passing actor-isolated properties as inout to async functions.
  3. Fix for Resolving Corrupted Package.resolved File:

    • Deleted and regenerated the corrupted Package.resolved file to fix build errors.
    • Ensured that all dependencies are correctly resolved and consistent across environments.

Related Issues

Checklist

Screenshots

thecoolwinter commented 3 months ago

I'm not too sure what you mean by the fix to the actor-isolated properties. This is currently compiling, so Swift doesn't seem to care about isolation here and the dispatch to the main actor is required to modify that property to make SwiftUI happy. Also correct me if I'm wrong but your patch doesn't fix actor isolation, it just weakly references self but still references everything else the same.