Get syntax tag by pos

Is there a way to get the syntax tag by pos, so that we can display some syntax-tree-related information by current cursor position?

Yes, something like syntaxTree(state).resolve(pos) (see docs) should do what you want.

1 Like