Update language grammar without restart


Hello, I am very new to modifying or creating packages for atom.
My goal was to add some extra grammar to language-pfm package (for now without creating my own one).
As the patterns are always quite tricky it would be great when I could see the changes immediately when I save the pfm.cson file where the grammar is defined.
However I cannot figure out how to do so. I have tested two packages which promise to do this but they seem not to work in this case. Is it possible at all?

How do other people who develop new grammars act on this? Restart the editor or the window takes way to long.



I agree that it is a painful process.
No there is not a way to avoid the dreaded restart AFAIK.

You can however have two sessions open and restart only the one session.

Use Ctril+Shift+F5 for the software driven restart. And consider blocking web access to Atom while you are playing around - Else Atom phones home on each restart.



Can you think on an other tool for testing the grammar before adding it to atom at all?

Thanks for the quick reply.


I am but 2 months young on this… so my ‘NO’ answer does not mean much.
If you are willing to wait a little for an answer, someone else might answer.
Is there any particular thing that is a challenge for you making the grammar?


Try adding this to your init.coffee:

atom.commands.add 'atom-text-editor', 'custom:load-active-editor-as-grammar', ->
    editor = atom.workspace.getActiveTextEditor()

Make a keybinding for it and use it when you make a change to a grammar file but don’t want to reload, or to write a grammar file without bothering to make a proper package folder for it.


@DamnedScholar: Thanks, that works like a charm. I was able to change the grammar in a much shorter time with this hint.


Thank you for a helpful tip. I’d give you x2 likes if I could.

I especially like this bit… that can be handy.