function (editor, currentPos) {
return editor.getTokenAt(currentPos);
}
I am designing a code editor for a custom language. So, I want do autocompletion based on mode state. I want to get token before .
like when we press CTRL + space during hello
. Then, my method should give me hello
so I can suggest some properties related to it. How can I do this?
The javascript-hint addon does something like this, continuing to get the previous token in a loop until it finds something that is not a property. You probably want code that looks similar.