[R-SIG-Mac] Xcode and R

Demitri Muna thatsanicehatyouhave at mac.com
Fri Sep 18 23:51:14 CEST 2009

On 18 Sep 2009, at 17:20, David Winsemius wrote:

> Thats not where I find such files on my system. All the .xclangspec  
> files are in one directory
> ~me$ find /Developer -name \*.xclangspec
> /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/ 
> Resources/Ada.xclangspec

I'd strongly recommend not touching (or adding to) those. Note the  
"Private" there. :) Those are the languages built into Xcode. Apple  
does provide a way to add your own without modifying the system. I'm  
not 100% sure the path I gave is right as I've seen different ones, e.g.

<-- useful

Ah, I just moved the files to this path and they registered with Xcode  
- it seems to have changed between 2.x and 3.x:

~/Library/Application Support/Developer/Shared/Xcode/Specifications

That one is correct. Put the files in there, and in an Xcode project,  
open an R file, do a "get info", and change the "File Type" to  

> When I drag those two files to that directory, Xcode does some  
> highlighting but only of non-reserved words and comments, and also  
> does "(" and "{" matching if you move the cursor forward over a ")"  
> or "}", but not if the cursor is moved backwards.)  Also shows some  
> code completion. I'm not sure what was _supposed_ to happen, but I  
> do see some behavior that suggests _some_ of those efforts were  
> having a desired effect.

So, it wasn't working in that path I gave first. What you were  
probably seeing was Xcode interpreting the file as a rez (resource)  
file, not R. But try the path above. Since they share the same  
extension, you'll have to select it manually (as above).

Finally, I don't know the details of the internals of those files. I  
made a quick five minute hack at it, adding the keyword list, calling  
it "R", but not much more. It's *definitely* buggy and will need work,  
but should give someone a push in the right direction. Google will help.


More information about the R-SIG-Mac mailing list