-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Add a setting to auto save after delay when stopped typing #46338
Comments
Hi. Is this point resolved today? Does exist a setting we can set in settings.json i.e. ? Else does exist simply a way to set a delay in this auto-save, without looking for typing or not ? Thanks for answers... |
there could be an option to autosave when the editor loses focus. Because while typing you may stop to think and it could throw type errors easily. Or if autosave while typing, do it when no clear errors on file. |
In my
I think you missed the Using
|
"autoSave" "afterDelay" is actually really buggy. Because it doesn't wait until after you are done typing, it only waits after you have made changes, and it will autosave while you are still moving the cursor to another spot to make more changes. The expected behavior should be -- wait until all keyboard input is done, then start the delay timer. That way a user can move to the next spot (like a closing bracket a few lines down) without having to worry about racing against the editor saving a broken,due to the buggy delay code -- to then easily navigate to the next area, make changes, then wait for the delay to start to save. it should be called "afterDelayFromChanges" and "afterDelay" should actually wait until .. there is a total delay in keyboard input. this is really nasty bug in my opinion, I am constantly having go to to 'autosave off' then make my changes, then turn autosave back on -- or all my nodemon watch tests will fail, unless I am fast enough to get to the next area (usually a closing bracket) needing changes. |
This causes a lot of performance degradation for me. I'm also running nodemon and often the VSCode process will freeze due to poor save delay timing. |
Completely agree with all the above. In fact, I honestly don't understand why anyone would want it to save while they are actively interacting with the UI. I would think be it default behavior or a separate setting that ideally it should wait for the app to be completely idle before starting the delay period. And by idle, I mean not just keyboard interaction but mouse as well. If you wanted to get REALLY technical, I'm kind of ok with mouse interaction outside of focus being considered "idle" but definitely if I'm actively typing or using the mouse within the file, I would not want the autosave delay to start counting down. For those who code for long periods without a gap long enough for the autosave delay to kick in, there could be a new setting created that is basically "if we haven't autosaved in the past X minutes due to constant user activity, proceed with autosave anyway". This way it's seemingly the best of both worlds. |
@liesislukas and others, the code that triggers auto save today will work as requested: as long as the editor is being modified, the auto save is pushed out. You can see that from the code here:
I am not sure what the original author saw or if it still applies, but I would go ahead and close this issue as invalid unless someone can show me an actual problem with auto save. |
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! |
Steps to Reproduce:
It should save after delay:
Or we could have another option:
"files.autoSaveWhileTyping": false
and it would wait till no keyboard input for e.g. 250ms before autosaving, then wait for autoSaveDelay and then save.Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: