getTokenAt method

Token getTokenAt(
  1. Position pos, [
  2. bool? precise
])

Retrieves information about the token the current mode found before the given position.

If precise is true, the token will be guaranteed to be accurate based on recent edits. If false or not specified, the token will use cached state information, which will be faster but might not be accurate if edits were recently made and highlighting has not yet completed.

Implementation

Token getTokenAt(Position pos, [bool? precise]) {
  var r = precise == null
      ? callArg('getTokenAt', pos.toProxy())
      : callArgs('getTokenAt', [pos.toProxy(), precise]);
  return Token.fromProxy(r);
}