Part of the package I am developing [https://github.com/irrationalistic/atom-tasks] requires that the user can change part of the grammar by editing their settings. I’ve got it mostly working by loading in the CSON grammar file by hand and passing it to an instance of a new Grammar. This way, whenever the user changes a setting by using config.observe, I can remove the current grammar and add a brand new one. Problem is that if the user already has a todo file open, the grammar of that specific file isn’t re-run.
Is there a way to force re-activation of a grammar via code? Or a better way to add/remove a changing grammar?