Using VS Code for Remote Development
TL;DR: This issue sums up our options for how to use VS Code. We have to decide if we want to go the proven route of using the desktop VS code (and having it separate from WebIDE) or using the Web IDE but doing more work.
VS Code desktop or web?
VS Code supports two modes, desktop mode (when you run VS Code on your computer) and web mode (when VS Code runs in your browser https://vscode.dev). We plan on using the web mode for our new WebIDE (Replace Web IDE with client-only VS Code (&7683)).
The web version doesn't support many extensions and other features like a language server or Git. We'll have to implement many features (like source code versioning &7684 (closed)) ourselves.
The desktop version supports client-server architecture, where the server can run on a different machine than the client. Also (very confusingly) the VS Code server can expose an HTTP server and serve the VS Code client as a web app (not to be confused with the web version of VS Code).
VS Code Desktop - client-server mode
This feature of VS Code is undocumented and we will have to look at the code to understand how to use it. (it seems complex)
VS Code supports running in a client-server configuration. The "client" can be either another VS Code instance or a web application (not to be confused with VS Code for Web). Running the client as a web application is a solved problem, see the <code data-sourcepos="19:247-19:257">code-server</code> investigation or the gitpod-io/gitpod-vscode-desktop. Using a local VS Code instance as a client is not a solved problem and I don't know how to do that yet.
Client-server mode is used by Remote - SSH extension, GitHub Codespaces, Gitpod, code-server and others.
AFAIK the VS Code Open Source project already contains all the code for running in a client-server configuration. I assume that based on investigating <code data-sourcepos="23:193-23:203">code-server</code> and from looking at what Remote - SSH installs in the container (good pairing with @vtak). It seems that all that CodeSpaces and Gitpod are doing is orchestrating the VS Code client and server.
Conclusion
If we want to use VS Code as the main IDE, we should decide whether we want to use strictly WebIDE (web version of VS Code) or we want to use the desktop version as others do. If we use only WebIDE, we'll lose a lot of functionality. If we use the desktop version, we won't be 100% consistent with WebIDE.
2022-07-12 Edit - In the last paragraph I made a typo:
- If we use only WebIDE, we'll use a lot of functionality.
+ If we use only WebIDE, we'll lose a lot of functionality.