I’m developing a package relaying on grammar scopes to highlight dynamically some words. I can correctly execute my script every time something change in the
TextEditor subscribing to
onDidStopChanging() events, but I can’t figure out how to execute it when I open a new file or I open Atom with a Texteditor tab already open.
I know that I could use some
WorkSpace events like
onDidAddPaneItem(), but it seems that when the callback is executed, the
Grammar has not yet tokenized the content of the
TextEditor, resulting in no syntax scopes available to be used by my script.
Does anyone know the correct way to do this?