Become a MacRumors Supporter for $25/year with no ads, private forums, and more!
  • Did you order new AirTags? We've opened a dedicated AirTags forum.

jw2002

macrumors 6502
Original poster
Feb 23, 2008
391
59
I am using Xcode 7.3.1 and NVIDIA CUDA 8.0, and I cannot get .cu source files to automatically format as works for .c, .h, .cpp, etc in the Xcode editor. I could swear that earlier versions of Xcode (or maybe it was Bbedit?) had a place in the preferences where additional file extensions could be easily added so that they would be recognized and be indented/formatted. Does anyone know if this feature still exists? Thanks.
 

jw2002

macrumors 6502
Original poster
Feb 23, 2008
391
59
Does Ctrl + I (indent) not work for you ?

Nope, most definitely not. Essentially, a .cu file loads like any plain, unformatted text file. Everything is a black font, meaning no contextual coloring, no smart indent behavior, etc. Cutting/pasting/ctrl-i have absolutely no effect.
 
Comment

0002378

Suspended
May 28, 2017
675
671
Nope, most definitely not. Essentially, a .cu file loads like any plain, unformatted text file. Everything is a black font, meaning no contextual coloring, no smart indent behavior, etc. Cutting/pasting/ctrl-i have absolutely no effect.

Gotcha.

Have you looked here ? https://stackoverflow.com/questions/1573968/xcode-source-automatic-formatting

Looks like others have faced the same problem and have come up with some hacks to get it to work. XCode seems to suck (and I think so too) when it comes to formatting.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.