textmate / swift.tmbundle

TextMate support for Swift
72 stars 30 forks source link

Match opaque result types per SE-0244 #44

Closed jtbandes closed 3 years ago

jtbandes commented 3 years ago

Documentation:

Opaque result types are used heavily in SwiftUI code, for example:

Since some is a keyword that pertains only to types, it can still be used as a regular variable name. So this PR adds a pattern for let/var declarations with types, so that the some pattern can be enabled only where appropriate.

func opaqueTypes() -> some View {}
struct Foo {
  let some: Int? = .some(42)
  var body: some View {}
}