About Xcode 4 language support

591 views
Skip to first unread message

Andrea D`Amore

unread,
Jan 27, 2012, 4:04:55 AM1/27/12
to Cappuccino & Objective-J
All messages on the subject I could read are few months old so I think
it's correct to ask it clearly: is there any new on language support
in Xcode 4?

I have to say that XcodeCapp offers a great integration, really. But I
could really use code folding and colored syntax.

I've checked the xclangspec and tried to edit DevToolsCore.framework
and DVTKit.framework but without success. :-)

Has anyone some resource about Xcode 4 and extended xclangspec? Old
info and tutorials don't seem to apply anymore.

What I find weird is that if I grep PrivateFramework with a few of the
entries in File Inspector -> File Type pop-up menu I only get results
from binary files (e.g. check "Ada source"). I expected to find it in
the NIB _and_ in some plist.


Any highlight or thought appreciated.

Aparajita Fishman

unread,
Jan 27, 2012, 7:57:31 AM1/27/12
to objec...@googlegroups.com
> All messages on the subject I could read are few months old so I think
> it's correct to ask it clearly: is there any new on language support
> in Xcode 4?


Nothing new, I don't expect anyone to try getting proper Cappuccino support in Xcode. Use a dedicated editor like Sublime Text 2 or TextMate, there is a Cappuccino bundle which provides colored syntax support with code folding.

http://www.sublimetext.com/dev
https://github.com/aparajita/Cappuccino-Sublime

Regards,

Aparajita
Cappuccino Core Developer

Alex Karahalios

unread,
Jan 30, 2012, 4:06:05 PM1/30/12
to objec...@googlegroups.com, Andrea D`Amore
A few years ago I added support for Xcode editing in Cappuccino. I haven't really been maintaining it, but I just now added a new shell script file (Add-Objective-J.sh) which will allow you to install Xcode editing support for Xcode 4.2+. The needed files area at

https://github.com/araxara/cappuccino/tree/Xcode/Tools/Editors/Xcode

You will probably have to edit the DVTFOUNDATION_PATH variable to point to the appropriate path for your Xcode installation. Some examples are provided. The ObjectiveJ.xclangspec file which is in the Git repository has not been updated to version Objective-J version 2.0, but should provide more than adequate editing support. If you do update the xclangspec just let me know and I'll update the repository.

You will manually need to select the proper language in Xcode (Editor -> Syntax Coloring -> Objective-J)

Hope this helps you.

Alex Karahalios

Andrea D`Amore

unread,
Feb 4, 2012, 10:29:50 AM2/4/12
to Cappuccino & Objective-J
On Jan 30, 10:06 pm, Alex Karahalios <alexkarahal...@gmail.com> wrote:
> You will probably have to edit the DVTFOUNDATION_PATH variable to point to the appropriate path for your Xcode installation. Some examples are provided. The ObjectiveJ.xclangspec file which is in the Git repository has not been updated to version Objective-J version 2.0, but should provide more than adequate editing support. If you do update the xclangspec just let me know and I'll update the repository.

> You will manually need to select the proper language in Xcode (Editor -> Syntax Coloring -> Objective-J)

I set DVTFOUNDATIONPATH to /Applications/Xcode.app/Contents/
SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/ and run
Add-Objective-J with root permissions, I see the relative entry
correctly merged in DVTFoundation.xcplugindata but I cannot see
ObjectiveJ in file inspector's pop-up menu.
I do have ObjJ specifications in ~/Library/Application\ Support/
Developer/Shared/Xcode/Specifications .

What else could I check?

Alex Karahalios

unread,
Feb 4, 2012, 10:51:29 AM2/4/12
to objec...@googlegroups.com, Cappuccino & Objective-J
I had the this issue too, but it seemed to correct itself after a few reboots and restarting Xcode a few times. It seemed some caching was going on. The most reliable way of getting it to work has been to run the script right after installing Xcode (do not run Xcode first). Maybe you can uninstall Xcode first, reinstall and then run the script.

Nigel Goodship

unread,
Apr 12, 2012, 7:31:13 AM4/12/12
to objec...@googlegroups.com
So far I've been developing in Cappuccino using Xcode 3 on Snow Leopard, but I'm now moving to Lion and hence also Xcode 4.  To start with, I thought I'd move to Xcode 4.2 on Snow Leopard and see if I could get my project working with that.  Thanks to the information here, I've managed to get the Objective-J language support working.

At first, I couldn't get Xcode to pick up the new language specs, but Alex's thought that "some caching was going on" turned out to be correct.  After much investigating, the cache file in question turned out to be this one:

/private/var/folders/CT/CTnMG0UmHGaCMJN83uW2vE+++TQ/-Caches-/com.apple.DeveloperTools/4.2/Xcode/PlugInCache.xcplugincache

My Snow Leopard system only has one directory in /private/var/folders/CT so you should be able to find your way passed that fairly easily.  

On a colleague's Lion system, the cache file has this path:

/private/var/folders/nx/5lx_7_cx4nb15m44mntrs5b0000103/C/com.apple.DeveloperTools/4.3.2/Xcode/PlugInCache.xcplugincache


The first part of this path can be found using the lsof command (list open files) on the Xcode process and searching the results for cache files.


I haven't tested this in Xcode 4.3 yet, but hopefully this info will be of some help to anyone else in a similar position.

Benjamin Graubner

unread,
Apr 29, 2012, 5:44:57 PM4/29/12
to objec...@googlegroups.com
Hi Nigel,

could you give us a shot overview what to do when we have found the cache file? What did you do to implement Cappuccino into Xcode 4+?

Cheers

R D

unread,
Apr 30, 2012, 2:44:49 PM4/30/12
to objec...@googlegroups.com
Hi, I'm also interested if there is a solution for synthax highlighting and code completion in Xcode 4.3 since I'm using Interface Builder and XCodeCapp. Would be practical to have the coding and ui-design all integrated into one environment (i know there is atlas but it's still beta and I don't know how to get an invitation code).

I tried all the steps above but I can't find any of these cache files...

Alex Karahalios

unread,
Apr 30, 2012, 3:00:24 PM4/30/12
to objec...@googlegroups.com
Take a look at

https://github.com/araxara/cappuccino/tree/Xcode/Tools/Editors/Xcode

and check out the file "Add-Objective-J.sh" which performs the installation of the Cappuccino syntax highlighting in Xcode 4.3. This version of "Add-Objective-J.sh" deletes the cache files too.

I still haven't updated the "Read Me.rtf" or the "install.command" files in a while and they reflect an older version of Xcode.

Alex Karahalios

R D

unread,
Apr 30, 2012, 6:19:55 PM4/30/12
to objec...@googlegroups.com
Hi Alex,

thank you for the help! Right after I executed the updated Add-Objective-J.sh I restarted Xcode and Objective-J syntax coloring was available in the Editor menu!!!
Works great. Now I will try to figure out how you solved this.. 
Reply all
Reply to author
Forward
0 new messages