"Jump to definition" for methods without external parameter names

For method calls with external parameter names, e.g.


let a = Array(count: 3, repeatedValue: 0)


I can command-click on any parameter name to jump to the method definition, in this case


init(count: Int, repeatedValue: Element)


However, if all parameter names are empty such as in


let c = Array("abc".characters)


I haven't found a way to do the same.


Of course I can lookup that the characters method returns a String.CharacterView which in turn conforms to SequenceType, so this will probably be


init<S : SequenceType where S.Generator.Element == _Buffer.Element>(_ s: S)


but I wonder if there is a simpler way. In particular, if a type has many overloaded init methods (without external parameter names) it can become difficult to determine which one is acutally used.

Accepted Reply

My question was answered on Stack Overflow http://stackoverflow.com/a/32052597/1187415, this looks like an acceptable workaround to me:

You have to do some work:

let c = Array.init("abc".characters)

//           ^^^^^

Use initializer expression, then cmd + click on it.

Replies

My question was answered on Stack Overflow http://stackoverflow.com/a/32052597/1187415, this looks like an acceptable workaround to me:

You have to do some work:

let c = Array.init("abc".characters)

//           ^^^^^

Use initializer expression, then cmd + click on it.