-
Notifications
You must be signed in to change notification settings - Fork 33
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 Python adding extra characters in code. #389
Comments
@TheWizardofGauze can you add the following two settings to User settings.json?
These are hidden settings, you won't find them in the UI. After adding these settings, Go to Output > Python Language Server, and clear the logs, do the same with Output > Black Formatter. Then reproduce the bug, and share the logs from both Python Language Server and Black Formatter. |
@TheWizardofGauze Thanks for the logs. Just one more bit, from black-formatter can you share the request |
With the exact code and extensions, I am not able to repo this. Can you share the contents of your environment?
I am suspecting something is interfering with diff calculation. |
|
What is your python version and what is your file encoding? |
Python 3.8.10 and UTF-8 |
I have been trying to repo this locally. For some reason I am not able to :( . |
Disappointing to hear, but I appreciate your effort to help. It seems like it's only effecting my main file so I can still use it with everything else in the meantime. I'm in the process of building a new PC anyway so I'll see if it goes away with a fresh install. |
A user figured out the cause for this. Closing in favor of: #395 as that has more details. |
Type: Bug
Tried testing with both Black and autopep8 with similar results, Extension Bisect pointed at ms-python.python.
I was editing a file for my bot and noticed that it was adding characters when I saved, with both auto format and manual, and only towards the end where my new code was. Not really sure if there's any steps to outline but I can give an example.
Before:
After:
Extension version: 2023.20.0
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: