Re: OT: Swift Code Autoformatter?

2016-01-15 Thread sqwarqDev
> On 15 Jan 2016, at 03:36, Charles Jenkins wrote: > > there’s no way for the end user to create them. A combination of AppleScript, sed and awk will pretty much do anything you can imagine in terms of text formatting, and they’re all included on you mac already; no need

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Charles Jenkins
Thank you, squarqDev and Charles! I’ll give sed/awk a go! Quincey, your responses are normally very helpful, so I’m sorry I picked an example that bothered you. It’s not that it’s too much trouble for me to manually fix a typo like “let half = numerator /2”; I just wanted a completely

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread sqwarqDev
> On 15 Jan 2016, at 17:38, sqwarqDev wrote: > > tell application "Xcode" > tell source document 1 > set _sourceCode to contents > > -- do shell script //do all your formatting here BTW, please don’t put a ‘do shell

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Quincey Morris
On Jan 15, 2016, at 04:49 , Charles Jenkins wrote: > > so I’m sorry I picked an example that bothered you. It’s not that it’s too > much trouble for me to manually fix a typo like “let half = numerator /2”; I > just wanted a completely innocuous example And I’m sorry I

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Charles Jenkins
Quincey, That’s a fantastic suggestion! I work in VS all day, and I’m quite happy with how I can set up formatting rules in it. If VS Code is as rich for Swift, I’ll be able to do most of what I want automatically within it. --  Charles On January 15, 2016 at 13:47:47, Quincey Morris

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Jens Alfke
> On Jan 15, 2016, at 10:47 AM, Quincey Morris > wrote: > > — You have a utility that assists conversion from (say) Obj-C to Swift by > reformatting at least the easy things according to the destination language > syntax. This is the use case that the

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Charles Srstka
> On Jan 14, 2016, at 2:57 PM, Quincey Morris > wrote: > > On Jan 14, 2016, at 12:36 , Charles Jenkins > wrote: >> >> I keep eyeing a program that you can install to work with Xcode and >> autoformat source

Re: OT: Swift Code Autoformatter?

2016-01-14 Thread Graham Cox
> On 15 Jan 2016, at 7:57 AM, Quincey Morris > wrote: > > To clarify for lurkers, Swift requires a space after the “/“ in “numerator / > 2” because spaces aren’t just lexical white noise in Swift Hooray. I feel vindicated - I’ve always insisted on this

Re: OT: Swift Code Autoformatter?

2016-01-14 Thread Eric E Dolecki
The compiler barks when you try things like that. You are your best code formatter :) Sent from my iP6+ > On Jan 14, 2016, at 8:15 PM, Graham Cox wrote: > > >> On 15 Jan 2016, at 7:57 AM, Quincey Morris >> wrote: >> >> To

Re: OT: Swift Code Autoformatter?

2016-01-14 Thread Quincey Morris
On Jan 14, 2016, at 17:15 , Graham Cox wrote: > > That’ll shut them up … Unfortunately not. I got in a huge fight with someone in the developer forums a year ago over this. This person was of the opinion that the inability to tolerate missing spaces was characteristic

Re: OT: Swift Code Autoformatter?

2016-01-14 Thread Quincey Morris
On Jan 14, 2016, at 12:36 , Charles Jenkins wrote: > > I keep eyeing a program that you can install to work with Xcode and > autoformat source code. You know, things like automatically fixing spacing > around arithmetic operators and other important types of punctuation.

OT: Swift Code Autoformatter?

2016-01-14 Thread Charles Jenkins
I keep eyeing a program that you can install to work with Xcode and autoformat source code. You know, things like automatically fixing spacing around arithmetic operators and other important types of punctuation. This is oddly important in Swift, where the compiler can’t interpret things like