Hello ) How are you ?
Maybe you know, how to get a token (lezer token) from updateListener.of as we can do it in context.tokenBefore([])
EditorView.updateListener.of((mirror: ViewUpdate) => return just text .
const viewState = mirror.state;
const range = viewState.selection.ranges[0];
const textPos = viewState.wordAt(range.from);
if (textPos) {
const text = viewState.sliceDoc(textPos.from, textPos.to);
I am using not only letters but also characters.
How or Can i get the full data of the text from the current position as a token block.
For example - my token is #word.word!C1 - and when a user is clicking on this text i want to check - what is the token, and the text inside it. But i can get only part of it - word
And i hope is some way - not only -
const prevPos = viewState.wordAt(textPos.from - 1);
or some idea how to get character before and after the selected text.