textmate / swift.tmbundle

TextMate support for Swift
72 stars 30 forks source link

Add `import` snippet #30

Closed mkhl closed 7 years ago

mkhl commented 7 years ago

This adds a snippet to import modules into Swift code, tab trigger im.

This snippet hadn’t been dismissed in #18 but hasn’t been added by now, so I’m proposing its addition separately.

jtbandes commented 7 years ago

How about we allow a few options for the module being imported? For instance,

import ${1|Foundation,UIKit,AppKit,QuartzCore,CoreGraphics|}

(just a few off the top of my head; feel free to change the list)

mkhl commented 7 years ago

How about we allow a few options for the module being imported?

That’s a great idea!

I went with ${1|Foundation,Cocoa,UIKit,CoreData,CoreGraphics,WebKit|} because that’s the most common frameworks I’m aware of (and the list linked below states that one should prefer importing Cocoa over AppKit).

If we want a huge selection, there are comprehensive lists of

jtbandes commented 7 years ago

Nice 😄