CommonWealthRobotics / BowlerBuilder

A Full-Stack Robotics Development Environment.
http://commonwealthrobotics.com/
GNU Lesser General Public License v3.0
3 stars 2 forks source link

Support script editing in external editors #46

Closed Octogonapus closed 5 years ago

Octogonapus commented 5 years ago

We need to support editing scripts in external editors and IDEs. Having an in-BowlerBuilder option is great, but large projects and serious applications require industry standard tooling; therefore, we need to support editing scripts in any external editor or IDE. I think a simple but effective way to do this is by adding three features:

  1. A UI element which lets the user copy a script's path on disk. If we supported opening folders so users can edit scripts which are in their own repos they have cloned (i.e. not in the git cache), this wouldn't be necessary.
  2. A file watcher implemented using a WatchService so we can track changes made to a script on disk. This is important for two reasons:
    1. The default script editor should load the new state of a file if changes were made to it while the editor was out of focus. This will happen when a user edits a script in an external editor and tabs back into BowlerBuilder, expecting the script to reflect their changes.
    2. The default script editor needs to prompt the user when the contents of the script in memory and the script on disk have diverged. If the two are not equal, the user must choose to either keep what is in memory or keep what is on the disk. We can also present an option to view the difference between the two.
  3. Editor autosave. When a user stops typing for some small period of time, we can autosave the script. The intent of this feature is to provide a seamless transition from the editor in BowlerBuilder to an external editor.