aheze / Multiliner

An Xcode source extension to expand lengthy lines.
https://twitter.com/aheze0/status/1541578738239885312
MIT License
827 stars 23 forks source link

Suggestion: A second command to do the opposite - reformat a multiline function onto a single line #8

Open jgale opened 2 years ago

jgale commented 2 years ago

I'd love to have a second command that can do the opposite of Multiliner - reformat a multi-line call into a single line.

Background: Our company style guide says if a function call is under 120 chars it should be a single line, otherwise split up like Multiliner does. Often times when refactoring I'm deleting a bunch of parameters and the call would fit on a single line. I'd love a command to be able to reformat it quickly onto one line to check if it fits.

PS: This is incredible, I've been periodically searching for something like this for ages. Thank you so much for making it! You are going to save me a few minutes every day.

aheze commented 2 years ago

Sounds good, I'll add a Singleliner command. It would probably also be good if the extension could reformat the entire file and determine if it should apply Singleliner or Multiliner depending on the number of chars

aheze commented 2 years ago

Or maybe the number of parameters - anything more than 3 could be multiline

aheze commented 2 years ago

BRUH I clicked command enter and it closed it

jgale commented 2 years ago

Or maybe the number of parameters - anything more than 3 could be multiline

My preference would be number of characters, sometimes thing have long names or short names and fit easily.

Thanks so much for considering, and thanks again! This makes me so happy.