• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to specify that files of a particular type should be recognized as source code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to specify that files of a particular type should be recognized as source code?


  • Subject: Re: How to specify that files of a particular type should be recognized as source code?
  • From: Guillaume Billard <email@hidden>
  • Date: Fri, 13 Nov 2009 10:28:40 +0100


Le 12 nov. 2009 à 19:27, Sean McBride a écrit :

On 11/12/09 4:06 PM, Guillaume Billard said:

We're using many .INL files in our projects and they don't get syntax
coloring even though they contain C++ code.

I have the same problem, but with .txx extensions.

I can do a search (".inl") and list them in the Details view, select
all of them (Cmd-A) and in their common Info page (Cmd-I), set their
File Type to sourcecode.cpp.cpp.
Is there a way to set this globally?

I believe the answer is still no.  Last I looked into this, the best
solution was to hack Xcode's Info.plist. :(

Could you explain how to do this?
I searched the Developer folder for Info.plist files but none seemed related to Xcode.

If not, is bugreporter the place to make feature requests?

Yes.

Would the possibility to globally associate an extension to a file type be considered a new feature or an enhancement over the possibility to do it locally?


We generate our .xcodeproj files with a tool, so we may be able to force the file type of .INL files at this stage.
When a .INL file is included in the project, it looks like this in the .pbxproj file:
/* Begin PBXFileReference section */
...
4AFBA26302C6F9354FA83B0A /* File.inl */ = {isa = PBXFileReference; lastKnownFileType = text; name = File.inl; path = Source/File.inl; sourceTree = SOURCE_ROOT; };
...
/* End PBXFileReference section */

If I change the file type of File.inl in its Info page, the .pbxproj file turns into this:
4AFBA26302C6F9354FA83B0A /* File.inl */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; name = File.inl; path = Source/File.inl; sourceTree = SOURCE_ROOT; };

If I manually modify the .pbxproj file like this, the project still loads and builds fine:
4AFBA26302C6F9354FA83B0A /* File.inl */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = File.inl; path = Source/File.inl; sourceTree = SOURCE_ROOT; };

Are there any trade-offs for choosing one way to set the file type or the other (i.e. explicit or "last known")?


Thanks.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to specify that files of a particular type should be recognized as source code?
      • From: Guillaume Billard <email@hidden>
References: 
 >How to specify that files of a particular type should be recognized as source code? (From: Guillaume Billard <email@hidden>)
 >Re: How to specify that files of a particular type should be recognized as source code? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Xcode build result format
  • Next by Date: Prevent Plug-In from Linking Against App
  • Previous by thread: Re: How to specify that files of a particular type should be recognized as source code?
  • Next by thread: Re: How to specify that files of a particular type should be recognized as source code?
  • Index(es):
    • Date
    • Thread