microsoft / vscode-autopep8

Formatting support for python using autopep8.
https://marketplace.visualstudio.com/items?itemName=ms-python.autopep8
MIT License
20 stars 13 forks source link

Cannot Format Selection #189

Closed PhungXuanAnh closed 1 year ago

PhungXuanAnh commented 1 year ago

When I select a piece of code, and then choose Format Selection, vscode raises a pop-up as in below image:

image

these are my configurations:

"[python]": {
        "editor.defaultFormatter": "ms-python.autopep8",
        "editor.formatOnSave": true,
        "editor.formatOnPaste": true,
        "editor.formatOnSaveMode": "modifications",
    },
"autopep8.path": [
    "/home/xuananh/.pyenv/versions/3.9.0/bin/autopep8" 
],
"autopep8.interpreter":[
    "/home/xuananh/.pyenv/versions/3.9.0/bin/python"
],
"autopep8.args": [
    "--max-line-length", "120", "--experimental",
    "--global-config", "${workspaceFolder}/setup.cfg"
],
"autopep8.showNotifications": "onError",
"autopep8.importStrategy":"fromEnvironment",

Ubuntu 22.04 Vscode 1.83.1 autopep8 2.0.4 (pycodestyle: 2.11.1)

karthiknadig commented 1 year ago

@PhungXuanAnh Please use the pre-release version of the extension. This is fixed there.