Xcode 3 language specification changes

So much has changed in Leopard that I am not surprised I cannot find anything about this yet. Basically, the plugin interface for Xcode 3 has severely changed. In particular, over the past few days I have been trying to make a *.pblangspec file for the programming language used by my group for software verification purposes (who, it ought to be noted, I do not speak for on this website).

It turns out, that’s not what I really wanted to do. I am still trying to figure out what all has changed, but here are a few key differences:

  • The file format is totally different. This is somewhat superficially noted by the fact that the file’s extension should now be xclangspec as opposed to pblangspec. For instance, I am using Resolve.xclangspec.
  • The file format is totally different. I’m mentioning it twice, mainly to point out that there are no guides out there for it yet. It seems to make sense, if you realize that Xcode is now doing a lot more than just keyword matching and using regular expressions to do purty fancy-dancy hi’-li’t’n’. However, it is really easy to mess up and make Xcode be unable to open. Basically, always keep backups so you can undo any of your changes.
  • And here’s why it’s taken me so long to even get this far, in that you need a confluence of these this and the previous two things to find out if anything you’ve done actually works: the location has changed. You used to be able to put your file in a location like ~/Library/Application Support/Apple/Developer Tools/Specifications/, but this won’t work any more. Xcode 3 now looks in places such as /Developer/Library/Xcode/Specifications/. I suspect ~/Library/Xcode/Specifications/ might also work, but I haven’t tried it.

If you want to get a look at how these plugin files look, check out /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/. Personally, I am trying to use a modified C++.xclangspec, but with enough work you probably could make a totally new spec. There are also xccolortheme and xcsynspec files to take a look at. I think it goes without saying that you want to modify copies of these things.

Technorati Tags: , , , ,

Comments

Anonymous said…
Hi Bruce,

Have you had any more luck on this? Is there still a requirement for something like an .xcfilespec?

Any other hints on how to get this to work? I wanted to create a plugin for Groovy, as the old one won't work of course.
Bruce M. Adcock said…
Unfortunately, I have not gotten any further on this (but I haven't had much time, either). I don't think an xcfilespec is necessary, because I can't find one for any of the other languages. There is, however, more going on here than I understand yet. If I take the C++ specification file and (editing a copy, of course), replace all occurrences of "xcode.lang.cpp" with "xcode.lang.resolve", and simply add some keywords, the highlighting gets all messed up on switching to Resolve (but is fine if I don't add any new keywords). It's really too bad none of this is mentioned in the Xcode user guide. There seems to be a lot of power here, but danged if I know what I can do, or how I can do it.
Anonymous said…
I'll let you know if I have any more luck. There are only a few places on the net that make mention of the new files, and it seems people have only stumbled on them by accident...
I've found some help at http://go-mono.com/forums/#nabble-td14971764 from Andreas Faeber. There are three files he has listed that I modified for a parallel language that I use called ASC.

Those files and some info can be found online at http://www.cs.kent.edu/%7Essteinfa/asc.html#ascXcode
Anonymous said…
Hi.

If you are interested then I am trying to gather people and resources into a single project explaining the xcode API.

Would love it if you were interested in joining.

http://code.google.com/p/xcode-plugin/

Popular posts from this blog

iPhone and iPod Touch, 802.1X and LEAP

Redux on iPhone and iPod Touch, 802.1X and LEAP