插件

  • SFTP
  • Python

配置

sftp.json

用于同步本地代码和远端服务器代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "name": "remote sync",
    "host": "remote host",
    "protocol": "sftp",
    "port": 22,
    "username": "username",
    "password": "password",
    "remotePath": "remote project path",
    "uploadOnSave": true,
    "ignore": [
        ".vscode",
        ".git",
        ".DS_Store",
        ".idea",
        "venv",
        "__pycache__"
    ]
}

tasks.json

用于一键启动远端程序

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "run project",
            "type": "shell",
            "isBackground": true,
            "command": "ssh",
            "args": [
                "username@remote",
                "'cd /project/path; run project command'"
            ]
        }
    ]
}

launch.json

用于监听远端debug端口

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "起飞,上天",
            "type": "python",
            "request": "attach",
            "connect": {
                "host": "remotehost",
                "port": 10006
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "remote project"
                }
            ]
        }
    ]
}