noseglid / atom-build

:hammer: Build your project directly from the Atom editor
https://atom.io/packages/build
MIT License
248 stars 97 forks source link

Refresh targets when grammar changes? #471

Open idleberg opened 8 years ago

idleberg commented 8 years ago

I'm aware of #451 and this is going into a similar direction, but it's not quite the same (and maybe not necessary if that other issue is solved).

I was wondering whether refreshTargets() should be called whenever the grammar of the current view changes. This could be done using the onDidUpdate, but I couldn't get it to work myself (otherwise there would now be a pull request). The aim would be to limit the amount build providers shown in the dropdown, since one could then run a simple grammar test in isEligible(). What are your thoughts on this?

Of course, this could be pushed a little further, for instance by calling refreshTargets() on atom.pane.onDidChangeActiveItem.