在2022年4月,vscode-python更新了说明如下

根据2022年4月的公告,我们的团队一直在努力将我们在Visual Studio Code的Python扩展中提供的工具支持分解为单独的扩展,以提高性能、稳定性,并不再需要在Python环境中安装这些工具 - 因为它们可以与扩展一起提供,这还允许在相应工具的新版本可用时,将这些扩展单独发布,与Python扩展分开发布

参考官方公告:https://github.com/microsoft/vscode-python/wiki/Migration-to-Python-Tools-Extensions

以前用的格式化配置settings.json如下

{
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,``
        "**/.hg": true,
        "**/CVS": true,
        "**/__pycache__": true,
        "**/.DS_Store": true,
        "**/venv": true,
        "**/.pytest_cache": true
    },
    "python.formatting.provider": "yapf",
    "python.formatting.yapfArgs": [
        "--style={column_limit=256}"
    ],
}

这份配置现在会提示警告

This setting will soon be deprecated. 

Please use the Autopep8 extension or the Black Formatter extension.

Learn more here: https://aka.ms/AAlgvkb.

根据官方文档,可以自由选择pylintflake8autopep8等等,这里以Black Formatter为例,更新的settings.json如下

{
    ...
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter"
    },
    "black-formatter.args": [
        "--line-length=256"
    ]
}

所以只是格式稍微变动了下,废弃了python.formatting.provider,也不再要求python环境安装对应的格式化插件了