An Xcode Source Editor Extension for macOS that provides convenient source code formatting and file header management tools for Swift, C, C++, and Objective-C files.
- Update File Header — Automatically updates the "Modified" date in file headers while preserving the "Created" date and intelligently handling copyright year ranges (e.g., 2024–2026)
- Insert Separator Comment — Inserts a horizontal line comment (
/*----...----*/) - Insert Asterisk Box Comment — Creates a decorative comment box with asterisks
- Insert Dash Box Comment — Creates a decorative comment box with dashes
- Insert Equals Sign Box Comment — Creates a decorative comment box with equals signs
- Insert Function Trace Comment — Automatically adds
print("# Gee Dbl A: Entering functionName()")statements to all functions in the file - Remove Function Trace Comment — Removes previously added function trace comments
The companion macOS application allows you to maintain a list of copyright holders that the extension recognizes when updating file headers.
- Swift source files (
.swift) - Swift Playgrounds
- C/C++ source and header files (
.c,.cpp,.h,.hpp) - Objective-C source files (
.m,.mm) - Xcode strings files
- macOS (recent versions)
- Xcode
- Download the latest release or build from source
- Move
XcodeGeeDblA.appto your Applications folder - Launch the app once to register the extension
- Enable the extension in System Settings → Privacy & Security → Extensions → Xcode Source Editor
- Restart Xcode
- Open any supported source file in Xcode
- Select Editor → XcodeGeeDblA from the menu bar
- Choose the desired command
You can also assign keyboard shortcuts to these commands via Xcode → Settings → Key Bindings.
git clone https://github.com/YourUsername/XcodeGeeDblA.git
cd XcodeGeeDblA
open XcodeGeeDblA.xcodeprojSelect your development team in Signing & Capabilities for both the app and extension targets, then build and run. The extension will be automatically built and registered.
The build.sh script automates a full release build including code signing and notarization. It extracts your team ID from the Developer ID Application certificate in your keychain, so no team ID needs to be stored in the project file.
Prerequisites:
- A Developer ID Application certificate installed in your keychain
- A notarization keychain profile named
notary-profile(created viaxcrun notarytool store-credentials)
./build.shThe script performs the following steps:
- Locates your Developer ID Application signing certificate
- Extracts the team ID and injects it into the Xcode project file
- Builds a Release configuration with
xcodebuild - Code signs the resulting
XcodeGeeDblA.app - Submits the app for Apple notarization and waits for approval
- Staples the notarization ticket to the app
- Cleans up by removing the team ID from the project file and any generated build artifacts
On completion, a signed and notarized XcodeGeeDblA.app is ready for distribution in the project root.
For extension debugging, use the pluginkit command-line tool:
# List registered extensions
pluginkit -m -v -i com.gee-dbl-a.XcodeGeeDblA.Extension
# Reset extension registration
pluginkit -e use -i com.gee-dbl-a.XcodeGeeDblA.ExtensionXcodeGeeDblA/
├── XcodeGeeDblA/ # Main macOS app (SwiftUI)
│ ├── XcodeGeeDblAApp.swift
│ ├── ContentView.swift # Copyright holders management UI
│ └── Assets.xcassets/
├── Extension/ # Xcode Source Editor Extension
│ ├── SourceEditorCommand.swift # Core extension logic
│ ├── SourceEditorExtension.swift
│ ├── Constants.swift # Supported UTI definitions
│ └── Info.plist # Command registrations
└── BuildEnv/ # CI/CD and build scripts
Contributions are welcome. Please read the Contributing Guidelines and Code of Conduct before submitting a pull request.
This project is licensed under the MIT License — see LICENSE.markdown for details.
Copyright 2024 Gary Ash
