vizier-scala icon indicating copy to clipboard operation
vizier-scala copied to clipboard

Open code in local editor

Open okennedy opened this issue 5 years ago • 9 comments

Currently code editing has to happen in the notebook itself. This is cumbersome for large files and user-hostile.

Suggestion: Add a feature to open code in a local editor.

Desiderata

(in decreasing-order of value)

  • The ability to use an arbitrary text editor of your choosing to edit files.
  • Click-to-edit from a web user interface
  • Integration with e.g., mypy/flake8/IDE code completion/etc... (e.g., by declaring 'placeholder' files in the same directory)
  • Support for arbitrary websites, not just this one

Implementation Strategies

Create and monitor a temp file.

Dump the cell script to something like /tmp/[xxxxxxx].py and use open (OSX) or xdg-open (Linux) to open the script in the user's preferred editor. Monitor the script file for edits (e.g., polling or using inode watchers or something similar) and re-run the notebook whenever an edit is saved. This is simple and easy to pull off, but only works on local Vizier instances.

WebDAV

Have the server expose a WEBDAV filesystem listing available notebooks, with a file per (script) cell. The difficulty here is that right now module identifiers are versioned. That means the filename would change with every iteration. For this to work, we'd need a new "version independent" identifier in addition to the version.

The advantage is that this would work regardless of whether we're running desktop or server vizier, but doesn't give us a neat 'open' button on the UI.

FUSE

Like WebDAV, but use FUSE. This provides more reliable edit detection and client-side experience, but requires users to install fuse and a client-side app. With this requiring a client, however, an 'open' button would be possible.

okennedy avatar Jan 29 '20 17:01 okennedy