介绍 (Introduction)
Visual Studio Code is a popular Integrated Developer Environment (IDE) for developers. Its large selection of plugins, minimal design, and cross-platform support make it a great choice for developers of all levels. This tutorial focuses on using the Remote-SSH plugin to enable remote software development. With this plugin you can edit files on your local workstation, but run development tasks such as program execution, unit tests, or static analysis on a remote server.
Visual Studio Code是开发人员常用的集成开发人员环境(IDE)。 它提供了丰富的插件选择,最小的设计和跨平台支持,是所有级别的开发人员的绝佳选择。 本教程重点介绍使用Remote-SSH插件来启用远程软件开发。 使用此插件,您可以在本地工作站上编辑文件,但可以在远程服务器上运行开发任务,例如程序执行,单元测试或静态分析。
There are many reasons why this may be beneficial to you. For example, you may have a Windows workstation and want to develop on Windows, but your code will eventually run on Linux. You may need more RAM or processing power than your current machine has available, or you want to keep code off of your personal machine due to a company policy, or the desire to keep your workstation prestine.
有许多原因可能会对您有所帮助。 例如,您可能有Windows工作站,想在Windows上进行开发,但是您的代码最终将在Linux上运行。 您可能需要的内存或处理能力超出当前计算机所能提供的内存或处理能力,或者由于公司政策或希望使工作站保持原始状态而希望使代码不与个人计算机接触。
In this tutorial, you’ll enable the Remote-SSH plugin, configure Visual Studio Code to execute code on the remote server, and execute code from your local Visual Studio Code installation on the remote server.
在本教程中,您将启用Remote-SSH插件,将Visual Studio Code配置为在远程服务器上执行代码,并在远程服务器上的本地Visual Studio Code安装中执行代码。
先决条件 (Prerequisites)
In order to follow along with this guide, you’ll need:
为了遵守本指南,您需要:
- A local development machine running Windows, MacOSX, or Linux. This tutorial will not work on ChromeOS devices. 运行Windows,MacOSX或Linux的本地开发计算机。 本教程不适用于ChromeOS设备。
Visual Studio Code, which you can download and install from the official web site.
Visual Studio Code,可以从官方网站下载并安装。
-
If you’re using macOS or Linux, you can follow Step 1 from How to Set Up SSH Keys on Ubuntu 18.04. The commands are the same, so don’t worry that the tutorial says it is for Ubuntu 18.04.
如果您使用的是macOS或Linux,则可以按照如何在Ubuntu 18.04上设置SSH密钥中的步骤1 进行操作 。 这些命令是相同的,因此请不要担心该教程说它适用于Ubuntu 18.04。
If you’re using Windows, follow the tutorial How to Create SSH Keys with PuTTY on Windows to create your SSH Key.
如果您使用的是Windows,请按照如何在Windows上