Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting documents doesn't work in autopep8. #7684

Closed
ttSpace opened this issue Jul 31, 2023 · 7 comments
Closed

Formatting documents doesn't work in autopep8. #7684

ttSpace opened this issue Jul 31, 2023 · 7 comments

Comments

@ttSpace
Copy link

ttSpace commented Jul 31, 2023

Describe the bug

image

Steps to Reproduce

  1. Check Formatter (Tools/Options/Text Editor/Python/Formatting) is autopep8.
  2. Type
######this is a comment
import os,sys;
spam( ham [ 1 ], { eggs : 2 } )
def foo    ():pass
x=1;y     =2;
y = 2
  1. Go to Edit > Advanced >Format Document

Expected behavior

After the package is installed successfully, the code will be automatically formatted.

Additional context and screenshots

Nothing has changed.

image

Logs

Output for Pylance in the Output panel

Info: (9948) Server root directory: c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist
Info: (9948) Pylance language server 2023.7.30 (pyright 74d8f3c4) starting
Info: (9948) virtual workspace: C:\Users\vting\source\repos\PythonApplication13\PythonApplication13
Info: (9948) Starting service instance "PythonApplication13"
Info: Un-registering request handler for 016c6a06-5755-46cc-8125-a7e6fcd06a25 failed.
Info: (9948) Setting pythonPath for service "PythonApplication13": "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"
Info: (9948) Assuming Python version 3.9
Error: (9948) File or directory "\Users\vting\source\repos\PythonApplication13\PythonApplication13" does not exist.
Info: (9948) No source files found.

@StellaHuang95
Copy link
Contributor

I can't repro this one on Microsoft Visual Studio Enterprise 2022 (64-bit) - Int Preview Version 17.8.0 Preview 2.0 [33930.147.main]. Could you try again? Thanks.

@ttSpace
Copy link
Author

ttSpace commented Aug 1, 2023

@StellaHuang95 I can repro in today's build.

image

@StellaHuang95
Copy link
Contributor

@ttSpace, I still can't repro this. Could you try again? Maybe also try reinstalling autopep8?

@ttSpace
Copy link
Author

ttSpace commented Aug 24, 2023

@StellaHuang95 I can repro in today's build. Also try to reinstall autopep8, still doesn't work.

image

@StellaHuang95
Copy link
Contributor

@ttSpace Can you share a gif of your repro steps?

@ttSpace
Copy link
Author

ttSpace commented Aug 25, 2023

@StellaHuang95

autopep8_ git

Logs

Output for Pylance in the Output panel

Info: (11580) Pylance language server 2023.8.20 (pyright fcee52c7) starting
Info: (11580) Server root directory: c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist
Info: (11580) Starting service instance "PythonApplication1"
Info: Un-registering request handler for 9a0f2662-42e4-4c8c-b028-974eb8932e74 failed.
Info: (11580) Setting pythonPath for service "PythonApplication1": "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\python3.9.exe"
Info: (11580) Assuming Python version 3.9
Info: (11580) Found 1 source file
Info: (11580) Background analysis(1) root directory: c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist
Info: (11580) Background analysis(1) started
Info: (11580) Found 2 source files
Info: (11580) Found 1 source file

@ttSpace
Copy link
Author

ttSpace commented Sep 4, 2023

@StellaHuang95 I cannot repro in today's build.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants