The original repository can be found on GitHub: XcodeClangFormat
Tested with version 1.2.1 (commit 240bba0)
- Clone the original repository from GitHub (XcodeClangFormat)
- Navigate into the directory (
cd XcodeClangFormat
) - Make sure to read the README.md file
- Execute
./configure
in the repository directory, which will generate an xcconfig file
ARCHS = x86_64
Link XcodeKit.framework
to clang-format meta-target and Embed without Signing.
Trying to run a debug build can result in a greyed-out menu item in Xcode.
These are the steps necessary to get it working:
- Make sure you have no other clang-format bundle installed on the system
- Uncheck it from the Extensions list in System Preferences
- Clean rebuild the extension
- Run the debug build
- ⌘+Q Xcode (make sure it has no dot under the dock icon)
- Check the clang-format entry on the Extensions page
Even if everything is done correctly, sometimes the extension cannot be found on the Extension page in System Preferences, or the complete section Xcode Source Editor can be missing.
This happens more often when there are multiple parallel versions of Xcode installed on the system.
To fix this, Quit Xcode (⌘+Q) and run the following command:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "/Applications/Xcode.app"
This command forces Launch Services to force-update the bundle information.