使用Python扩展时,使用yapf -当我点击格式时什么都不会发生:
我的工作区设置:
// Place your settings in this file to overwrite the default settings
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/js-build": true
},
"editor.scrollBeyondLastLine": false,
"python.pythonPath": "/Users/joshma/.envs/venv/bin/python",
"python.linting.flake8Path": "/Users/joshma/.envs/venv/bin/flake8",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"editor.formatOnType": true,
"python.formatting.provider": "yapf",
"python.formatting.yapfPath": "/Users/joshma/.envs/venv/bin/yapf"
}我所采取的步骤:
foo('a' )的函数调用cat path/to/file.py | yapf将该行格式化为foo('a')有可能我没有正确设置某些路径/配置--有什么方法可以调试吗?
发布于 2016-05-25 12:26:08
我觉得你错过了这个选择,
python.formatting.formatOnSave
这是我的配置,格式化工作,
"python.formatting.formatOnSave": true,
"python.formatting.provider": "yapf",
"python.formatting.yapfPath": "/usr/bin/yapf"https://stackoverflow.com/questions/36636227
复制相似问题