microsoft/vscode-autopep8

Extension 'autopep8' is configured as formatter but it cannot format 'Pyton'-files

Rawalanche opened this issue · 3 comments

image
I have latest stable version of the autopep8 extension.

I have configured it exactly as requested:

"[python]": {
    "editor.defaultFormatter": "ms-python.autopep8"
},

image

There is no "python.formatting.provider" set anywhere. Not in user nor in workspace/folder settings.

I don't have autopep8 python package installed, so I expect the extension is using its own.

The formatting does not work, whatsoever. When trying to format manually using "Format Selection" command, I get this error:
image

The selection popup doesn't list autopep8 as available for formatting Python files:
image

Windows 11 22H2
VSCode 1.83.1
autopep8 v2023.6.0
Happens both with global environment as well as virtual environment.

Here's the log:
autopep8.log

This is fixed pre-release please give it a try.

Note that this happens when you try to format with selection. You should be able to still format whole documents using the "Format Document " command.

This is fixed pre-release please give it a try.

Note that this happens when you try to format with selection. You should be able to still format whole documents using the "Format Document " command.

I tried pre-release and I can confirm this works now.

That being said Format Document doesn't work either on the stable release channel. Basically no formatting works whatsoever, so this bug certainly is not restricted to just Format Selected command.

@Rawalanche If you have text selected VS Code will automatically use Format Selection when you run any type of formatting command. We will be pushing the pre-release to stable soon.