microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.29k stars 29.31k forks source link

File save is not reliable #228049

Closed laszlozahoranszky closed 1 month ago

laszlozahoranszky commented 2 months ago

Type: Bug

I could not save files. VS Code did not indicate exactly which files were edited already, it only showed that there are files to be saved. Also, git did not update the edited files. Making changes in files and trying to manually save them one by one did not work either. Not knowing which files were edited out of the 50+ open files, this was quite frustrating.

VS Code version: Code 1.93.0 (4849ca9bdf9666755eb463db297b69e5385090e3, 2024-09-04T13:02:38.431Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 7600X 6-Core Processor (12 x 4691)| |GPU Status|2d_canvas: enabled
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|63.15GB (21.84GB free)| |Process Argv|--crash-reporter-id 694e8c55-cbaa-4ad9-884f-db4f0c8c96d3| |Screen Reader|no| |VM|0%|
Extensions (41) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.5.0 vscode-django|bat|1.15.0 markdown-mermaid|bie|1.24.0 simple-react-snippets|bur|1.2.8 format-json|Cle|1.0.3 dart-code|Dar|3.96.0 flutter|Dar|3.96.0 python-environment-manager|don|1.2.4 python-extension-pack|don|1.7.0 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|15.4.0 vscode-jest-runner|fir|0.4.73 copilot|Git|1.229.0 copilot-chat|Git|0.20.0 plantuml|jeb|2.18.1 vsc-python-indent|Kev|1.18.0 git-graph|mhu|1.30.0 debugpy|ms-|2024.10.0 python|ms-|2024.14.0 vscode-pylance|ms-|2024.9.1 remote-ssh|ms-|0.114.1 remote-ssh-edit|ms-|0.86.0 remote-explorer|ms-|0.4.3 autodocstring|njp|0.6.1 material-icon-theme|PKi|5.10.0 java|red|1.34.0 markdown-preview-enhanced|shd|0.8.14 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-boot-dev-pack|vmw|0.2.1 vscode-spring-boot|vmw|1.56.0 vscode-gradle|vsc|3.16.4 vscode-java-debug|vsc|0.58.0 vscode-java-dependency|vsc|0.24.0 vscode-java-pack|vsc|0.29.0 vscode-java-test|vsc|0.42.0 vscode-maven|vsc|0.44.0 vscode-spring-boot-dashboard|vsc|0.14.0 vscode-spring-initializr|vsc|0.11.2 material-ui-snippets|vsc|3.3.8 jinja|who|0.0.8
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 vscrpc:30673769 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 945dj816:31013170 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl1:31134654 refactort:31108082 pythonrstrctxt:31112756 flightc:31134773 wkspc-onlycs-t:31132770 wkspc-ranged-c:31125598 ei213698:31121563 ```
gjsjohnmurray commented 2 months ago

If you are displaying your editors as Tabs the ones with unsaved changes should have a dot by their label.

https://code.visualstudio.com/docs/getstarted/userinterface#_tabs

There's also an Open Editors view that indicates these.

bpasero commented 2 months ago

Do you have auto save enabled?

laszlozahoranszky commented 2 months ago

There were only two visual clues that there are files to be saved in vs code. The explorer icon showed a dot with 4 in it (i.e. 4 files to be saved) and the file >save all button was enabled.

I have the open editors on the right sidebar. It had no white dots next to any files, but it did show all the opened files. The file tab headers in the middle also haven't got any 'dirty' flags (white dot also next to the filename).

So. the UI was in an inconsistent state.

The auto save was on, so I should not really have had any unsaved files (I was working on existing files in a git repo).

I tried to edit more files just to see what happens but none of the files could be saved and there were no feedback that they got edited anywhere.

Additionally, when I tried to close vs code, a dialog popped up, that I have never seen before, stating something about saving changes takes longer than expected. I was saving to my local SSD (so no remote filesystem was involved). No other program experienced this and after restarting vs code, I could save again (i.e. I can rule out system-wide issues).

I had a suggestion form github copilot that I neither accepted nor declined in a file while the issue occurred. That might have contributed to the glitch.

bpasero commented 2 months ago

You can still have unsaved indicators for untitled files that are not auto saved. If you can find steps how to reproduce please post them.

vs-code-engineering[bot] commented 1 month ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!