textmate / swift.tmbundle

TextMate support for Swift
72 stars 30 forks source link

Inheritance and other fixes #23

Closed jtbandes closed 7 years ago

jtbandes commented 7 years ago

These changes address the following cases:

func foo(bar: T)  // GitHub will color `bar` properly if we swap the order of its two scopes

typealias Foo<T> = Bar<T, Int>  // right-hand side are generic params, not variables; also comments should be allowed here

protocol P: class { }  // support class-requirement

// allow protocols to use associated types in where clauses <https://github.com/apple/swift-evolution/blob/master/proposals/0142-associated-types-constraints.md>
protocol IntSequence : Sequence where Iterator.Element == Int { }

class C: A, B { }  // make inheritance matching more intelligent so the comma isn't entity.other.inherited-class

// use $ instead of \n so the following are both matched properly
protocol A {
  associatedtype Iterator : IteratorProtocol
  associatedtype SubSequence : Sequence where SubSequence.Iterator.Element == Iterator.Element
}