The following Objective-C code in XCode (which compiles)
NSString *someString = @"Lorem ipsum dolor.\nEget nisl nec risus";
after running Uncrustify becomes
NSString *someString = @"Lorem ipsum dolor.
Eget nisl nec risus";
which doesn't compile. Is there any way to avoid it changing line breaks embedded in an NString? I have been searching and reading the forums, as well as the cryptic Uncrustify config file and have been unable to find an answer.
By the way, I am using version 0.60 of Uncrustify.
Figured it out!
The problem is not with the config. It's with the AppleScript that is ran. On my system the AppleScript is at ~/Library/Services/Uncrustify_opened_Xcode_sources.workflow.
Basically reworked it a bit to be functional for the latest version of Uncrustify by modifying the generated document.wflow within the Uncrustify_opened_Xcode_sources.workflow application. Runs great for me, but might need adjustments. I only changed lines 99-105. I deleted the blockers.
https://github.com/heliumroe/Xcode-formatter/compare/octo-online:master...patch-1?quick_pull=1 for more details!
if (suffix = "m" or suffix = "h") then
tell application "Xcode" to (do shell script "'/usr/local/bin/uncrustify' -c " & "'" & uncrustifyConfigFilePath & "' -l OC --no-backup '" & currentDocumentPath & "'")
end if
end repeat
display dialog "DONE"
end tell