commandbox-cfformat icon indicating copy to clipboard operation
commandbox-cfformat copied to clipboard

Support function_call.multiline.element_count differences between named and unnamed args

Open bockensm opened this issue 4 years ago • 3 comments

Here's the use case.

results = service.getApplications(
    name: "John",
    sort_by: "Name DESC"
)

writeDump(
    var: results,
    label: "results"
);

I'd like to always break named arguments to one line per argument because it's more readable. Supporting the max number would be fine, so if someone wants to support up to 2 or 3 before breaking that can be done. I'd just set it to 1 to break all

vs

results = queryExecute( sql, params );
writeDump( results );

The existing configs could take effect for this case where you can break either on element count or line length. It should not be restricted just to built-in functions because I often use named parameters for functions like writeDump.

I acknowledge that this is a backwards compatibility nightmare.

bockensm avatar Feb 26 '21 21:02 bockensm

@bockensm Thanks for these feature requests. I have not missed them. I am sorry for the lack of response, things have been busy for me at work, and your requests require some thought, and, I think, in some cases some work to implement. They do make sense to me as requests, they just weren't of the 5 minute change variety, so I kept putting them off. I will try to write up some thoughts and questions in the near future.

jcberquist avatar Apr 30 '21 00:04 jcberquist

@jcberquist No worries, John. Thanks for taking the time to comment with an update.

bockensm avatar Apr 30 '21 01:04 bockensm

So currently I feel like this is a little bit too specific a formatting feature to implement. As you know, I already have a significant number of settings in the library, and I would like to avoid adding so many settings that it becomes difficult to keep track of and support all of them as well as deal with the interplay between settings.

jcberquist avatar May 02 '21 22:05 jcberquist