• 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: Mon, 16 Nov 2009 10:24:39 +0100


Le 13 nov. 2009 à 10:28, Guillaume Billard a écrit :


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.

> Find Xcode.app in the Finder. Right-click on its icon and choose "Show Contents" from the popup menu.
> You should find Info.plist in the Contents directory.
(Thanks Jason)

I added a row with the value 'inl' under Document types -> Item 19 (C++ Source File) -> CFBundleTypeExtensions.
I saved the file, restarted Xcode, opened an existing project, but the .inl files still miss syntax coloring.
I tried with a fresh project, same result.

What am I doing wong?

Thanks.



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; }; 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>)
 >Re: How to specify that files of a particular type should be recognized as source code? (From: Guillaume Billard <email@hidden>)

  • Prev by Date: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
  • Next by Date: Console log swamped by malloc free_garbage warnings
  • 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