Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jw2002

macrumors 6502
Original poster
Feb 23, 2008
392
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.
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.