What I would like to do, is create a plugin (package), that adds autocomplete functionality to
package.json files. I started out with autocomplete-plus, which adds great features out of the box, but one thing I can’t seem to figure out: How to get access to the tokenized input of a file? As far as I understand, something must have done the tokenization, since there is already syntax highlighting, and in the autocomplete-plus plugin I get access to the token names, before the cursor, so re-parsing the file seems wasteful, and unecessary.
So what would be a good way to do this? I have access to a
TextEditor instance, and I can also get the appropriate
Gramar from the editors registry.