custom language for xcode

Hi,


Is there a relatively easy way to add a custom language to xcode? (templates, syntax highlighting, etc.)


I often work in "R", a statistical programming language and would love to use xcode to write my code.


Thanks!

Mac OS X (10.7)

Posted on Sep 5, 2011 10:34 PM

Reply
3 replies

Sep 6, 2011 6:24 PM in response to noah977

noah977 wrote:


Is there a relatively easy way to add a custom language to xcode? (templates, syntax highlighting, etc.)

No. Xcode only fully supports a few of the most popular languages. There are resources to support an even greater number of languages, but not all of them are enabled. FORTRAN, for example, seems to be supported internally, but isn't "turned on". I see no support for R at all.

Sep 6, 2011 7:21 PM in response to noah977

noah977 wrote:


XCode must have something similar. Finiding it and deciphering the file format is the tricky part.

Finding and deciphering isn't all that difficult. The files are here:


/Developer/Library/PrivateFrameworks/DVTFoundation.framework/Versions/A/Resource s/

/Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/


How to get Xcode to recognize a new language is another story. I have tried to inspire the FORTRAN people to do that since they seem very upset that FORTRAN doesn't have syntax coloring in Xcode4. There is a "Fortran.xclangspec" file in there, but I wasn't able to get Xcode to use it. I admit that I didn't try that hard. If you could figure out how to get FORTRAN syntax highlighting to work, the FORTRAN programmers would really appreciate it, and you could probably hack-in R support as well. Of course, it may not be possible at all, so don't get too excited.


PS: Make sure to have good backups before hacking on Xcode internals.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

custom language for xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.