How does the local vscode client manipulate files in the remote machine? - visual-studio-code

With the remote-ssh extension, we can use vscode's remote development feature now, which means we can access the files in a remote machine from local vscode. And I found except the remote-ssh extension, there is a vscode-server working on remote machine to communicate with local vscode.
Looks like it's the bridge between local vscode and the file system in remote machine, which say vscode access remote files through the .vscode-server. But when I read vscode's source code, I still didn't find which protocol do they used to communicate, looks like it's not http, maybe it's ssh, but I still didn't get the details. Does any one know the details between local and remote on access remote file system? Such as how does the client initiate a file read, and how does the remote return the file content to the client, which protocol they use. And how remote executes command from local, such as the git commands in source control.
We can find some source code of the vscode-server in vscode:
https://github.com/microsoft/vscode/blob/main/src/server-main.js
https://github.com/microsoft/vscode/tree/main/src/vs/server/node

not a complete answer but the extension that provides the remote connection is Microsoft/Github's "remote-ssh" (https://code.visualstudio.com/docs/remote/ssh). VS Code uses the ssh channel for effectively a peer-to-peer proprietary exchange between the local and remote machines after bootstrapping the process by using the ssh connection to issue commands to install their VS Code Server and its dependencies.
VS Code extensions generally have a link in their info to a Github repo containing the source but in the case of remote-ssh the repo is for feedback only & the code does not appear to be open source.
(https://github.com/Microsoft/vscode-remote-release)
Note the remote-ssh extension is using remote code execution primarily to "take advantage of VS Code's full feature set" (presumably including remote build and debugging) rather than simple file access. That extension does provide remote file access, but there are far simpler extensions such as ftp-simple which provide only that.

Related

How to open the remote file in vscode without vscode server?

I am using the vs code for most of my development, but often I am accessing the FreeBSD system or low-resource machine which cannot handle having vs code server.
is there any way to open a remote file, without vscode server?
only basic edit capability is enough.

Can I add a remote Python interpreter (via SSH) to a local VSCode environment (i.e. a hybrid local/remote SSH setup)?

I have VSCode set up with the "Remote - SSH" extension, and I am able to run a local VSCode window as the face of a full remote environment. Really cool.
However, I would also like to be able to set up a local VSCode environment which loads files from my local filesystem but runs them on a remote Python interpreter (via an SSH connection).
I am hoping I can run all the regular interactive Python REPL stuff using the remote kernel (e.g. show variables, etc). It seems like I should be able to somehow add a remote kernel and then select it via "Python: Select Interpreter", but I can't figure out how.
In the past I was able to configure such a setup in JupyterLab using the "remote_ikernel" package.
Is this possible in VSCode? I've found tons of documentation on the full remote setup, but haven't located information on this hybrid kind of set up.
I found a related bug report which discusses mixing local and remote filesystems (not interpreters).
I suspect that the same difficulties it describes for filesystems may be similar reasons for why local files can not be easily fed into remote interpreters.
The full thread is here for reference:
https://github.com/microsoft/vscode-remote-release/issues/706
The specific quote:
Having a mixed workspace would require that a workspace extension can be active both locally and remotely. Currently an extension can only be active once, either locally or remotely. So this is currently not possible and we have no plans to support this.
The recommendation is to have separate windows open for the local and remote workspace.
So it sound like this is a feature that is not currently supported.

What does the >< badge mean in the VS Code extensions list?

When I connect to a remote workspace in VS Code, some of my enabled extensions have a badge with a >< icon. See the ESLint extension for example:
What does this badge mean and why do I only see it when I connect to a remote workspace?
That badge indicates that the ESLint extension is running on the remote machine. The extension should function the same as if it were running in a normal, local VS Code window.
In order to support remote development, VS Code distinguishes two classes of extensions:
UI Extensions: These extensions make contributions to the VS Code user interface and are always run on the user's local machine.
Workspace Extensions: These extensions are run on the same machine as where the workspace itself is located. When you open a local workspace, Workspace Extensions are run on the local machine. When in a remote workspace, Workspace Extensions are run on the remote machine.
The ESLint extension is a workspace extension that is run on the remote machine because it performs file access and other workspace operations. The badge in the extensions view indicates that is running on the remote machine

Is there any extension in Visual Studio Code , which is similar to Tramp Mode in Emacs?

TRAMP (Transparent Remote Access, Multiple Protocols) is a package for editing remote files, similar to AngeFtp or efs. Whereas the others use FTP to connect to the remote host and to transfer the files, TRAMP uses a remote shell connection (rlogin, telnet, ssh). It can transfer the files using rcp or a similar program, or it can encode the file contents (using uuencode or base64) and transfer them right through the shell connection.
It seems like as of now there is at least one similar package to Tramp mode for VSCode. I couldn't directly find in the documentation how you would open a remote shell inside VSCode, but it seems like it would have to be possible given the rest of the plugin.
https://code.visualstudio.com/docs/remote/ssh
https://code.visualstudio.com/blogs/2019/10/03/remote-ssh-tips-and-tricks
I have a terminal menu in VSCode that I can open up and directly ssh to stuff, so that seems to cover both sides of the "Tramp" mode usage
You can use FUSE for a somewhat similar effect. It's not editor specific, but mounts remote file systems via SSH, FTP and whatnot directly to your local file system so you can use it with any Editor.
You didn't mention on what operating system you, but here's the link to the version for macOS: https://osxfuse.github.io

How to edit java files in remote machine using eclipse

my project source code is in unix, we are using CM synergy source control for code checkin/chech out files. we update the files using vi editor. Pls help in how to set up eclipse in windows system and then connect to the code server and edit the files.
You could install the Remote System Explorer framework, that allows opening files from a remote server, and also gives shell access to the remote server. For anything more specific, I'm not sure whether a free solution exists.
I experienced some problems accessing remote file systems with the Remote System Explorer Plugin, the FTP session was closed unexpectedly. I recommend for linking in your local projects remote sites Aptana Eclipse Plugin.