I want to check if the cursor is inside a comment. So instead of doing it myself using complex regular expression or parsing I thought let’s use the built-in syntax highlighting but when using:
in the red area’s it gives
undefined. For all other cursor positions inside the block comment it returns “comment”.
getTokenAt doesn’t work. See my (by myself unfairly?) closed issue https://github.com/codemirror/CodeMirror/issues/4755
What am I doing wrong? Is there some other easy way to check if inside comment?