I would like to make some very specific changes to the configured code style for obj c, that aren't supported by the current options. I'm wondering if writing a plugin is the way to go about this, and if the obj c formatter is even available in the open api? I poked around a bit in the plugin code and didn't see a way to customize formatting for obj c.
Here's an example:
I want method call arguments to wrap if long, align by colons ONLY if it doesn't violate continuation indent. For example (indent is 2, continuation indent is 4, right margin is 20):
[obj withFoo:foo andBar:bar];
// is wrapped as I like:
// but this line with a longer message param name:
[obj withFoo:foo longMessage:bar];
// is wrapped in a way that violates my continuation indent:
// I would prefer in this case to align on the continuation indent:
There are a bunch of additional rules I'd like to add as well:
- Similar to aligning messages params / arguments on colons, in function calls I want to align the params / arguments only if doing so doesn't violate the right margin *and* keeps the argument intact. Otherwise, wrap at the continuation indent. Current behavior will wrap within an argument:
// current appcode:
- Nested method calls should have nested continuation indents.
- If wrapping any [method|function] [parameter|call argument], wrap them all (in the same style)
Any pointers on how to go about this would be appreciated.