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.xcodeprojBuild and run the main application target. The extension will be automatically built and registered.
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
