-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some ideas for future development #1
Comments
Hi @tvooo, Thanks a lot for the great feedback! I'm currently in the middle of finals week, so I won't be adding anything for the next couple days, but your method of finding all tasks and subtasks is exactly what I was looking for! Could you explain how your Sublime extension used cacheing? Were you originally running Grunt every time a user wanted to see the list of available tasks? Currently my extension parses the The one downside of that is that currently any tasks added to the Thanks, Nick |
Hi Nick, yeah, the problem with ST is that it runs on Python. Parsing the Gruntfile wasn't an option. So instead, we "inject" a task called By now, the You could work with the same technique, an md5 hash should be fine. Just save it internally, and check if the hash changed everytime you display tasks. Should still be really quick, and the list of tasks would be up to date any time. Good luck with your finals! |
That makes sense, I think I'll try to see if I can somehow watch the file for changes. Either through an Atom API like TextBuffers' events, or through a node module. That way I can preemptively parse the That should mean a little better UX, at the expense of an extra process running the whole time. |
Maybe you can hook a function into the Atom API that gets called when files change. I can imagine that they have a mechanism for that. This way, you wouldn't have to poll all the time and the footprint would be minimal. |
Fixed Known Issue kokarn#1- The Gruntfile must be in the root of your project directory to successfully get the available tasks. Additionally, all grunt commands will be called in the root directory. Now, the Gruntfile.coffee (or Gruntfile.js) can be in a sub-directory of the root directory. And all grunt will run in the Gruntfile directory.
Hey @nickclaw ,
I am the maintainer for sublime-grunt, the Grunt task runner for Sublime Text. I got my Atom invite today and am happy to see that you tackled the task of building a Grunt task runner for it, already :)
I would help you with a few pull requests, but I never used CoffeeScript, so maybe I can give you a few ideas on where to bring this plugin, instead.
Listing all tasks + multitasks
I understand that the fact that you're not listing all tasks is a bug. The way we extract tasks in sublime-grunt is more or less like that (removed a few unrelated lines, and it's JS obviously):
This should give you a list w/ all tasks + subtasks á la "compass:dev" and "compass:build", which you could then show in the task list. The fuzzy search of Sublime, and here Atom, helps a lot and the fact that you list all possible targets isn't a big deal because of this. We felt it was the best solution from a UX perspective.
Caching
I don't know if caching is necessary here. In sublime-grunt, we run a grunt command, pipe the output to Python and from there display the list of available tasks. The bottleneck may be somewhere there, but with huge Gruntfiles, we had to wait up to 2-3 seconds sometimes. We implemented a caching mechanism and this helped a lot. Might be interesting for atom-grunt-runner as well.
Cool, looking forward to see a nicely integrated Grunt solution for my next editor (maybe). You have the advantage of running an environment that is native to Grunt (JS/CoffeeScript), and you don't need to target different Python versions and platforms (as of now). If I can be of any help, let me know, I'll be glad!
Best, Tim
The text was updated successfully, but these errors were encountered: