xcode and go.xclangspec

323 views
Skip to first unread message

John Asmuth

unread,
Nov 20, 2009, 2:52:25 PM11/20/09
to golang-nuts
Hi,

Has anyone had any luck getting Xcode to use the go.xclangspec file
provided? I copy that thing to all sorts of places and nothing seems
to work (get-info on a source and looking in the 'type' list doesn't
have anything for go).

- John

Noah Evans

unread,
Nov 21, 2009, 6:13:30 AM11/21/09
to John Asmuth, golang-nuts
Did you try /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/?

Sebastian

unread,
Nov 21, 2009, 2:02:02 PM11/21/09
to golang-nuts
I added mine to /Developer/Library/Xcode/Specifications

Daniel Dilts

unread,
Nov 21, 2009, 2:29:39 PM11/21/09
to golan...@googlegroups.com
I think that the location to put the xcode files in is in a comment at the beginning of the files.

John Asmuth

unread,
Nov 21, 2009, 4:33:39 PM11/21/09
to golang-nuts
I have put it there and a number of other locations, but it doesn't
seem to have done anything. Perhaps it is installed correctly and I
don't know how to use it?

Daniel Dilts

unread,
Nov 21, 2009, 4:49:35 PM11/21/09
to golan...@googlegroups.com
> I have put it there and a number of other locations, but it doesn't
> seem to have done anything. Perhaps it is installed correctly and I
> don't know how to use it?


All it does is introduce syntax highlighting. It does not introduce anything else. Try opening a .go file in XCode. See if things are highlighted.

John Asmuth

unread,
Nov 24, 2009, 1:56:12 PM11/24/09
to golang-nuts
Surprisingly enough, this was the first thing I tried. To no avail.
> All it does is introduce syntax highlighting.  It does not introduce anything else.  Try opening a .go file inXCode.  See if things are highlighted.

Pete Wilson

unread,
Nov 25, 2009, 12:41:54 PM11/25/09
to golang-nuts
I added mine to /Developer/Library/Xcode/Specifications as suggested
by Sebastian.
On opening sieve.go, the display was ordinary black text.

The trick was to select View:Syntax Coloring:Go

That is, (i) the file does add go to what XCode understands but (ii)
you seem to have to tell the editor to use that syntax definition.

But the coloring doesn't 'stick'.
-- P

j-g-faustus

unread,
Nov 25, 2009, 1:24:02 PM11/25/09
to golang-nuts
I put mine in /Developer/Library/PrivateFrameworks/XcodeEdit.framework/
Versions/A/Resources, as suggested by Noah E (and it actually says so
at the top of the file, just open it in a text editor), and it worked
straight away. I didn't change any settings.

For Pete W: There are two files. It sounds like you are missing
go.pbfilespec, which ties the syntax highlighting to the file
extension .go. (It's in the Go distribution, just copy it to the same
place as the go.xclangspec.)

natevw

unread,
Dec 25, 2009, 10:38:17 AM12/25/09
to golang-nuts

For those coming across this groups post on a Google search, I found
this as a potential tip to install the file system-wide:
http://dh1135.posterous.com/go-programming-tip-where-to-put-the-gopbfiles

However, I used the method described in the text at the top of each
file, which is to put them deep within my Library folder:
~/Library/Application Support/Developer/Shared/Xcode/Specifications/

hope this helps,
-natevw

KenF

unread,
Dec 25, 2009, 4:51:01 PM12/25/09
to golang-nuts
I've posted some changes that add support for raw strings in another
discussion.

(I didn't realize this discussion was still active.)

Ken

On Dec 25, 7:38 am, natevw <nate-li...@calftrail.com> wrote:
> On Nov 20, 1:52 pm, John Asmuth <jasm...@gmail.com> wrote:
>
> > Hi,
>
> > Has anyone had any luck getting Xcode to use the go.xclangspec file
> > provided? I copy that thing to all sorts of places and nothing seems
> > to work (get-info on a source and looking in the 'type' list doesn't
> > have anything for go).
>
> For those coming across this groups post on a Google search, I found

> this as a potential tip to install the file system-wide:http://dh1135.posterous.com/go-programming-tip-where-to-put-the-gopbf...

Reply all
Reply to author
Forward
0 new messages