Skip to content

Re-organize helper functions#1539

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Jul 12, 2026
Merged

Re-organize helper functions#1539
cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

Only moving functions, no behavioral changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes several AppKit helper extensions by moving them out of the MarkEditMac app target and into the Modules SwiftPM package (primarily AppKitExtensions), and aligns some “Extension” naming to “Extras” in the app’s Sources grouping.

Changes:

  • Move NSMenu, NSSpellChecker, NSDocumentController, and Bundle helper extensions into MarkEditMac/Modules/Sources/AppKitExtensions.
  • Remove/trim the corresponding helpers from MarkEditMac/Sources/Extras / MarkEditMac/Sources/Extensions.
  • Update the Xcode project grouping/build references to reflect the new organization.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
MarkEditMac/Sources/Extras/NSSpellChecker+Extras.swift Removes the local declineCorrectionIndicator helper from the app target after moving it into AppKitExtensions.
MarkEditMac/Sources/Extras/NSMenu+Extras.swift Removes local menu-search helpers from the app target after moving them into AppKitExtensions.
MarkEditMac/Sources/Extras/NSDocumentController+Extras.swift Removes the local setOpenPanelDirectory helper from the app target after moving it into AppKitExtensions.
MarkEditMac/Sources/Extras/NSApplication+Extras.swift Header comment rename to match “Extras” naming.
MarkEditMac/Sources/Extensions/Bundle+Extension.swift Deletes the app-target Bundle.isDefaultApp(toOpen:) helper after moving it into AppKitExtensions.
MarkEditMac/Modules/Sources/AppKitExtensions/UI/NSPopover+Extension.swift Updates access/visibility and keeps sourceView helper in the shared extensions module.
MarkEditMac/Modules/Sources/AppKitExtensions/UI/NSMenu+Extension.swift Adds menu-search helpers (firstActionNamed, firstMenuNamed, etc.) to the shared extensions module.
MarkEditMac/Modules/Sources/AppKitExtensions/Foundation/NSSpellChecker+Extension.swift Adds declineCorrectionIndicator(for:) to the shared extensions module.
MarkEditMac/Modules/Sources/AppKitExtensions/Foundation/NSDocumentController+Extension.swift Adds setOpenPanelDirectory(_:) to the shared extensions module.
MarkEditMac/Modules/Sources/AppKitExtensions/Foundation/Bundle+Extension.swift Adds isDefaultApp(toOpen:) to the shared extensions module and adjusts imports accordingly.
MarkEditKit/Sources/Extensions/UserDefaults+Extension.swift Removes the NSNavLastRootDirectory constant now that the key is inlined elsewhere.
MarkEdit.xcodeproj/project.pbxproj Updates file references/groups (e.g., “Extensions” → “Extras”) to match the new layout.
Comments suppressed due to low confidence (1)

MarkEditMac/Modules/Sources/AppKitExtensions/UI/NSPopover+Extension.swift:12

  • sourceView is now provided by the AppKitExtensions module (and the extension is marked public), but current app call sites (e.g. MarkEditMac/Sources/Editor/Controllers/EditorViewController+UI.swift) don’t import AppKitExtensions. This will break compilation unless those files add import AppKitExtensions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

MarkEditMac/Modules/Sources/AppKitExtensions/UI/NSPopover+Extension.swift:12

  • sourceView is declared inside a public extension NSPopover, but the property itself is not marked public, so it remains internal and won’t be accessible from other modules (e.g. MarkEditMac).

@cyanzhong cyanzhong merged commit dc936ab into main Jul 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants