At GitLab we're exploring an idea that may turn the tide. I agree that online editors don't seem the way forward. The problems are:
- People have wildly different preferences (TextMate, Sublime, Atom, VScode, vim, emacs, etc.)
- It is really hard to get an online IDE right. The most advanced version is probably Eclipse Che and they have an API to do autosuggest by looking in all the files.
Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/22863
"It ought to be enough if one can trigger opening a buffer in a local editor, which accesses a local webserver provided by your browser, backed by the textarea, and having a means of updating the textarea on save via a POST issued from, say, Emacs to Firefox's textarea-httpd."
I think the better approach is to sync the entire directory so you can do global search and replace and autosuggest.
My idea of how to make the IDE sync work:
1. You click on an icon in GitLab, it is next to where we now show the url for the terminal.
2. The icon opens a url, with a schema specific for our solution (although we should open source the protocol so others can reuse it). In the url is the following information: server and project location, pod and container to connect to, a token to identify the user.
3. Beforehand the user has installed a local client that is registered to handle this type of schema.
4. The filesystem of the container is synched to the users machine by the local client (I propose to a default directory system specific to the local client).
5. The local client also opens up the favorite editor of the user (make this configurable with smart default by seeing what editors are installed via which).
6. The local editor talks to an endpoint of GitLab, similar to how our terminal works.
7. GitLab uses kubernetes/docker exec to run unison and fswatch on the container (this is a different approach that the volume approach suggested in https://github.com/leighmcculloch/docker-unison#docker ).
8. GitLab makes a reference implementation of this for MacOS, using unison and fswatch. The community will hopefully make Linux and Windows clients.
What do people think?
Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/22876