VS Code 开发配置

tasks.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "任务名称",
"type": "shell",
"command": "${config:python.pythonPath}",
"args": [
"${workspaceFolder}/manager.py",
"-web"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"problemMatcher": []
},
{
"name": "Python Debugger: bx.py with Arguments",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/manager.py",
"console": "integratedTerminal",
"args": "${command:pickArgs}"
}
]
}

sftp.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[
{
"name": "sftp name",
"host": "172.x.x.x",
"protocol": "sftp",
"port": 22,
"username": "username",
"password": "password",
"remotePath": "远程地址",
"uploadOnSave": true,
"useTempFile": false,
"openSsh": false,
"ignore": [
".idea",
".vscode",
".git",
".DS_Store",
"venv",
"__pycache__"
]
}
]

settings.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"editor.fontSize": 18, //编辑器字体大小
"workbench.colorTheme": "Winter is Coming (Dark Blue)",
"workbench.iconTheme": "vscode-icons", //vscode文件图标主题
"go.formatTool": "goimports", //golang格式化工具
"editor.defaultFormatter": "esbenp.prettier-vscode", //编辑器格式化工具
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
}, //javascript格式化工具
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
}, //vue格式化工具
"[go]": {
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "golang.go", //格式化器
"editor.suggest.snippetsPreventQuickSuggestions": false
},
"[python]": { // Python 格式化工具
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
},
// "black-formatter.args": [ // black 格式化参数
// "--line-length",
// "200"
// ],
"editor.insertSpaces": false,
"workbench.editor.enablePreview": false, //打开文件不覆盖
"search.followSymlinks": false, //关闭rg.exe进程
"editor.minimap.enabled": false, //关闭快速预览
"files.autoSave": "afterDelay", //编辑自动保存
"editor.lineNumbers": "on", //开启行数提示
"editor.quickSuggestions": { //开启自动显示建议
"other": true,
"comments": true,
"strings": true
},
"editor.tabSize": 4, //制表符符号eslint
"editor.formatOnSave": true, //每次保存自动格式化
"prettier.eslintIntegration": true, //让prettier使用eslint的代码格式进行校验
"prettier.semi": true, //去掉代码结尾的分号
"prettier.singleQuote": false, //使用单引号替代双引号
"javascript.format.insertSpaceBeforeFunctionParenthesis": true, //让函数(名)和后面的括号之间加个空格
"vetur.format.defaultFormatter.html": "js-beautify-html", //格式化.vue中html
"vetur.format.defaultFormatter.js": "vscode-typescript", //让vue中的js按编辑器自带的ts格式进行格式化
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
},
"prettier": {
"semi": false,
"singleQuote": true
},
"vscode-typescript": {
"semi": false,
"singleQuote": true
}
},
"eslint.validate": [
"vue",
// "javascript",
"typescript",
"typescriptreact",
"html"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"editor.fontLigatures": true,
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.env.osx": { // 命令行环境变量
"PYTHONPATH": "$PYTHONPATH:${workspaceRoot}"
},
"code-runner.runInTerminal": true, // 在终端运行方法
"code-runner.cwd": "${workspaceRoot}", // 运行时的父地址
"rest-client.environmentVariables": { // rest-client 使用的公共参数
"$shared": {}
}
}