Saving python file with "Format on Save" option checked takes a long time to complete
See original GitHub issueType: Bug
1- Open a python file 2- Add few lines of code to it. 3- Make sure Format on Save is checked and using autopep8. 4- Save the file.
Expected Result:
- Quick saving of file
Actual Result:
- File takes few seconds to save although it is very small.
Extension version: 2022.18.2 VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T04:27:29.066Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i5-9300H CPU @ 2.40GHz (8 x 2400) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off 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 skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
Load (avg) | undefined |
Memory (System) | 7.88GB (1.19GB free) |
Process Argv | –crash-reporter-id 720428a0-ec92-4540-bf47-7af1413d9d8a |
Screen Reader | no |
VM | 0% |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848:30577860
nodejswelcome1cf:30587006
fc301958:30595537
2e4cg342:30602488
gswce1:30605430
3d0df643:30608728
dbltrim-noruby:30604474
89544117:30607850
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Formatters are hanging when trying to format on save
Try tracking down which one causes the problem and filing an issue against them Formatters are run sequentially.
Read more >VSCode / Python / Pep8 works only when save file
So I have selected pep8 liter option and it works but is it possible to be more responsive? Right now it checks the...
Read more >VS Code tips — Format on save - YouTube
Today's VS Code tip: Format on saveAutomatically format your code when you save it. No more worrying about checking in unformatted codeUse ...
Read more >Automatically Format Code On File Save in Visual Studio ...
To automatically format the file on save, In Visual Studio Code, press Control + Shift + P or Command + Shift + P...
Read more >7. Input and Output — Python 3.11.1 documentation
Often you'll want more control over the formatting of your output than simply printing space-separated values. There are several ways to format output....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@karthiknadig @karrtikr I could today narrow this issue down further. It happens when I have any of the following options set: “editor.formatOnSaveMode”: “modifications”, “editor.formatOnSaveMode”: “modificationsIfAvailable”,
If I am formatting the whole file, formatting works fine.
Also note that I ran the Bisect Extension command and it pointed to the python extension as the source of the issue.
We do not support
editor.formatOnSaveMode
currently, so closing this issue in favor of https://github.com/microsoft/vscode-python/issues/14323. Feel free to upvote that to raise priority.