Pascal Syntax Highlighting in Xcode


Add Objective Pascal syntax highlighting to Xcode's code editor

  XcodeObjectivePascalSyntaxColoring.zip
Download and unzip the two files in this zip file. Run the objp_colors_xcode.sh script in a Terminal window. The script does 3 things:

  1. Backs up Xcode's DVTFoundation.xcplugindata to DVTFoundation.xcplugindata.bak
  2. Uses PlistBuddy to add an Objective Pascal section to DVTFoundation.xcplugindata
  3. Copies the ObjectivePascal.xclangspec file into the same folder as DVTFoundation.xcplugindata
When you next start Xcode, you should see "Objective Pascal" in the Editor | Syntax Coloring menu - select this for your .pas files. If you don't, do this:

In Finder, look under /var/folders until you find a folder named com.apple.DeveloperTools. In this folder you'll see folders that correspond to all of the versions of Xcode that you've ever run on your computer. Rename or delete the current version's folder (eg, 7.1-7B91b for Xcode 7.1). This is a cache folder and will be recreated the next time Xcode is run. Now start Xcode and you should see "Objective Pascal" in the Syntax Coloring menu.


Tip: For a better typing experience with Pascal, uncheck "Syntax-aware indenting" in Xcode preferences (on the Text Editing | Indentation tab).


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.