1,
launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Odoo",
"type": "python",
"request": "launch",
"pythonPath": "${config:python.pythonPath}",
"program": "${workspaceRoot}/source/odoo-bin",
"args": [
"-c",
"${workspaceRoot}/bin/odoo.conf"
],
"console": "externalTerminal",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/runtime/python",
"debugOptions": [
"RedirectOutput"
]
}
]
}
settings.json文件
{
//定义python的路径
"python.pythonPath": "D:\\MyCodes\\Odoo\\GOdoo12_community-20181026\\runtime\\python\\python.exe",
//使用这个,所以自动完成/转到定义将与python扩展
"python.autoComplete.extraPaths": [
"${workspaceRoot}/odoo/addons",
"${workspaceRoot}/odoo",
"${workspaceRoot}/myaddons",
"${workspaceRoot}/addons" ],
"python.linting.pylintPath": "pylint", //可选:如果您有环境路径,则使用Python的路径“
"python.linting.enabled": true,
//加载pylint_odoo
"python.linting.pylintArgs": ["--load-plugins", "pylint_odoo"],
"python.formatting.provider": "yapf", //一键美白代码格式
//"python.formatting.yapfPath“:”可选:如果你有环境路径,使用Python的路径“,
//“python.linting.pep8Path”:“可选:如果您有环境路径,则使用Python的路径”,
"python.linting.pep8Enabled": true,
//添加这个自动保存选项,以便在编辑时pylint会播放错误
//它只会显示文件保存的错误
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,
//下面将在编辑器中隐藏已编译的文件/添加其他文件以将其从编辑器中隐藏
"files.exclude":{
"**/*.pyc": true
}
}