findAt

fun List<Token>.findAt(position: Position): Token?

Finds a non-structure token at the given position. A token is considered to be at the given position if the position is within the token's location.

For example, given the following source code:

package foo.bar.baz

Any position within the token package will return that token, including bordering positions (before the p or after the e).

Return

the token at the given position, or null if there is no token at the given position