Looking for CM6 equivalent for getTokenAt(pos)

Just wondering what’s the simplest way to get a token at a specified position?
I checked the migration docs but couldn’t find anything relevant.
Thanks in advance.

syntaxTree(state).resolveInner(pos, -1) will give you the innermost syntax node at the given position, which might be what you’re looking for here.

1 Like

Thank you very much for the reply.