Get xcode to offset brackets by 1 space when there are arguments


#1

want to follow the juce style guidelines as much as possible, so i always put a space between a function call and the brackets for its arguments…but xcode doesn’t do that by default. Does anyone know if there’s a way to force that behaviour in xcode?


#2

Yeah that would be great. I got so much used to do it manually now that I don’t even notice it anymore, I just nudge the cursor back and hit the space button.

If anyone finds a way to do this automatically, I am sure we at JUCE/ROLI would appreciate that a lot :slight_smile:


#3

Perhaps we should collectively come up with a JUCE configuration for https://github.com/travisjeffery/ClangFormat-Xcode :sunglasses:


#4

Does that work while typing too, or is it just… “post-production”?


#5

I thought perhaps this could be modified to do the job… I don’t have time to do it though…

Rail


#6

@yfede, I believe it’s on your choice of:

  1. On save
  2. On key commands
  3. Menu options

…but not realtime whilst typing. I think option 1 would suit me…


#7

For me the preference would go to method 2, because “on save” would mean that it’d change it in places where I don’t see it, and I may want to break the rule from time to time for very specific reasons.

It would be interesting to investigate further the solution proposed by @Rail_Jon_Rogut, unfortunately I don’t have much time either :sob: