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:
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.
A file watcher implemented using a WatchService so we can track changes made to a script on disk. This is important for two reasons:
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.
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.
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.
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: