Our TestMace Visual Studio Code is one of the most popular tools. And all the more gratifying that it is developing by leaps and bounds. We offer you the translation of an article about another tasty feature, which is currently available only in VS Code Insiders.
I agree, I overdid it a bit with the headline, just emotions fill me up. I decided to share my first impressions of remote development in VS Code , at the time of this writing, available in VS Code Insiders.
Remote development extensions require the installation of Visual Studio Code Insiders .
The possibility of remote development in Visual Studio Code is the ability to use a container, remote computer or a Windows subsystem for Linux (WSL) as a complete development environment. In this case, the whole process is divided into two parts: the client part of the application runs on the local computer, and the VS Code server is almost anywhere. A set of extensions for remote development includes three extensions. The following three articles will help to study each of them in more detail:
Many developers, writing under Windows, create Windows virtual machines in the cloud, and then connect to the desktop via RDP and drive through Windows. In this case, the virtual machine performs all related operations. Developers writing under Linux create Linux virtual machines or containers and connect to them via SSH via the terminal, launch vim or tmux and write to the console. In this case, the virtual machine performs all related operations. In both scenarios, it is not a client-server connection, but the interaction of a terminal or thin client with a server. VS Code is a fat client with a clear and understandable language services interface and location transparency.
When you write code - for example, an instance of an object, and after the dot symbol (.) You have an auto-completion of the names of the contents of this object. Who does this work? Where does this list come from? If the code runs locally, and even in the container, you need to make sure that both parties (client and server) are synchronized, use the same SDK and the like. Not an easy task.
Suppose that Rust and the necessary development tools are not installed on your computer.
Then we clone the following repository:
git clone https://github.com/Microsoft/vscode-remote-try-rust
Run VS Code Insiders:
C:\github> git clone https://github.com/Microsoft/vscode-remote-try-rust Cloning into 'vscode-remote-try-rust'... Unpacking objects: 100% (38/38), done. C:\github> cd .\vscode-remote-try-rust\ C:\github\vscode-remote-try-rust [main =]> code-insiders .
Then VS Code asks if you want to open this container.
The devcontainer.json file contains a list of extensions required for the current project. The VS Code extensions will be installed into the Docker container, and then they can be used remotely. Your local system does not need all of them at all; it is enough to install only those that you plan to use in the current project. Of course, you can do without installing anything on your local computer at all, but the golden mean is to get rid of unnecessary manual configuration of the system.
Look at the screenshot below. Here the tools you need are added to the dockerfile file, the Docker executable file is launched, and we see the VS Code server!
Go to the Extensions section of the VS Code and note the lower left corner. The green status bar indicates that client-server interaction has been implemented. All the necessary Rust extensions are installed in a container and are ready for use in VS Code. The entire installation process took a few minutes.
By editing the code in this way, you get the same auto-completion, debugging, and more.
Here is an example of a real-time debugging application on Rust that does not require any configuration other than installing VS Code Insiders, Remote Extensions, and Docker (which I already had).
As I said, you can run the code using WSL, in containers or via SSH . This style of development is only gaining momentum. It is simple and clear, and it is very interesting for me to observe where this will lead us. We have to perform so many routine tasks , and remote editing of the code allows us to throw out all unnecessary things from the development process and concentrate our attention on the most important things.
Our team creates a cool TestMace tool - a powerful IDE for working with APIs. Create scripts, test endpoints and use all the power of advanced autocompletion and syntax highlighting. Write to us! We are here: Telegram , Slack , Facebook , Vk
Source: https://habr.com/ru/post/454280/
All Articles