-
Notifications
You must be signed in to change notification settings - Fork 37
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 extensions not working #420
Comments
@benjaminphalane How are you triggering formatting? You can also see Output > Black Formatter logs to see why it was not formatted. |
The screen shot shows the error. According to Python parser there is syntax error because there is an indent on line 4 that is not valid in Python. |
I created that error on purpose to test the formatting extension. |
You can try the following to see if formatting works:
After:
We block code from formatting if there are syntax errors. This is to preserve the current experience with notebooks. It will get better when we implement support to handle notebook cells with cell magic (like |
It works, thanks. I was surprised because the tutorial I'm following on YouTube had this working like a charm. |
Type: Bug
Download Black Formatter extension, set it as the default formatter and select a .py file and dilberately mess with the formatting and attempt to use Black Formatter to fix formatting in the file. (It didn't work when I tried)
VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:10.514Z)
OS version: Windows_NT x64 10.0.22621
Modes://
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: disabled_off
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
Extensions (5)
A/B Experiments
The text was updated successfully, but these errors were encountered: