Re: OT: Swift Code Autoformatter?
Re: OT: Swift Code Autoformatter?
- Subject: Re: OT: Swift Code Autoformatter?
- From: Quincey Morris <email@hidden>
- Date: Fri, 15 Jan 2016 10:47:32 -0800
- Feedback-id: 167118m:167118agrif8a:167118s7tz4SP1UQ:SMTPCORP
On Jan 15, 2016, at 04:49 , Charles Jenkins <email@hidden> 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 gave offense (and to the other Charles too, apparently). I was trying to answer the question you actually asked, which (I now suspect) was not the question you intended to ask (though I’m not sure).
I can understand use cases like these:
— You have a utility that you run on source files to reformat them according to a set of coding standards. This is sort of your use case, I suspect, or maybe not.
— 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 other Charles added to the discussion last night.
In such cases, you’re talking about a one-time operation directly on the source files. (You may enforce coding standards periodically, of course, but not continuously with a freestanding utility.) Xcode isn’t involved — you’re changing text files directly.
Here’s what you actually said:
On Jan 14, 2016, at 12:36 , Charles Jenkins <email@hidden> wrote:
>
> I keep eyeing a program that you can install to work with Xcode and autoformat source code.
You want something installable and to “work with” Xcode and to do its work automatically. I can’t interpret that to mean anything but that you’re looking for an Xcode plug-in, or perhaps some kind of global system text enhancer, that updates your formatting *live* in an Xcode editing pane as you type.
In that context, your example of the space following an operator seemed a bit odd, since that does in fact produce an error that’s hard to ignore (and easy to correct as you go). That was what I chose to respond to.
I didn’t respond to any other part of your question, because you didn’t tell us what kinds of non-error formatting (the kind that might creep in, as you type, without being noticed) you wanted, nor what rules your prospective “program” failed to provide, and because of the uncertainty of whether you wanted something interactive or one-shot.
In fact, I was going to suggest you take a look at Visual Studio Code (which is basically the IDE editor portion of Visual Studio, but running on OS X and other platforms). I haven’t tried it, so I don’t know how far along it is, but given Microsoft’s obsession with making things customizable you might find the formatting rules you want in its text editor.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden