Skip to content
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

Support auto save when delay is 0ms #135635

Closed
przemolb opened this issue Oct 22, 2021 · 9 comments
Closed

Support auto save when delay is 0ms #135635

przemolb opened this issue Oct 22, 2021 · 9 comments
Assignees
Labels
confirmed Issue has been confirmed by VS Code Team member feature-request Request for new features or functionality file-io File I/O help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@przemolb
Copy link

Issue Type: Bug

Hello,

I always setup VSC to immediately save to disk any modifications of any file

grep -i save .config/Code/User/settings.json 
    "files.autoSaveDelay": 0,
    "files.autoSave": "afterDelay"

But it looks like my autoSave settings doesn't work anymore and whenever I change anything in a file the change is not immediately saved and I need to press CTRL-S.
It used to work very well before.

VS Code version: Code 1.61.2 (6cba118, 2021-10-19T14:58:13.605Z)
OS version: Linux x64 5.4.0-87-generic
Restricted Mode: No

@bpasero
Copy link
Member

bpasero commented Oct 22, 2021

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@bpasero bpasero added the info-needed Issue requires more information from poster label Oct 22, 2021
@przemolb
Copy link
Author

I have tested it with the following version but it still doesn't work:

Version: 1.62.0-insider
Commit: f961b92f0faec5c68124ab4d89922d38cf6f513d
Date: 2021-10-28T05:17:31.098Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.4.0-89-generic

@bpasero
Copy link
Member

bpasero commented Oct 28, 2021

I wonder if this issue is being caused by an installed extension. Can you try to run VS Code without extensions? From the command line (NOT the integrated terminal in Code), execute: code --disable-extensions and try your steps again to see if it reproduces. If you see it is an issue with the extension, please file it against the extension repository itself.

@przemolb
Copy link
Author

przemolb commented Oct 28, 2021

Have just used code --disable-extensions but still no change - autosave doesn't work.

But there is some progress - when I set the Files: Auto Save Delay to 1 (one ms) it works (and the delay is acceptable ;-) ).
But it looks like value 0 (zero ms) is being ignored.

The 1ms delay works with both disabled and enabled extensions.

@bpasero
Copy link
Member

bpasero commented Oct 29, 2021

Ah ok, yes that is possible. What is the rationale for a auto save that is 0ms?

@przemolb
Copy link
Author

My understanding was that 0ms means instant save - you basically disable the delay. Am I right ?

@bpasero bpasero changed the title Autosave doesn't work Support auto save when delay is 0ms Oct 29, 2021
@bpasero bpasero added this to the November 2021 milestone Oct 29, 2021
@bpasero bpasero added file-io File I/O help wanted Issues identified as good community contribution opportunities confirmed Issue has been confirmed by VS Code Team member and removed info-needed Issue requires more information from poster labels Oct 29, 2021
@bpasero
Copy link
Member

bpasero commented Oct 29, 2021

I see how auto save does not work when files.autoSaveDelay: 0 is configured but I think we should support this as well, maybe even negative numbers.

If someone wants to investigate and provide a PR, opening for help wanted. There is probably a place where we check for if (autoSaveDelay) and that fails because of the 0 value.

@bpasero bpasero added feature-request Request for new features or functionality verification-needed Verification of issue is requested labels Oct 30, 2021
@przemolb
Copy link
Author

What would negative numbers mean in this particular case ?

@bpasero bpasero closed this as completed in f066322 Nov 1, 2021
@bpasero
Copy link
Member

bpasero commented Nov 1, 2021

Setting now supports a value of 0 but not below.

Verification: configure auto save to 0 ms and verify changes to files are auto saved.

@rzhao271 rzhao271 added the verified Verification succeeded label Nov 30, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmed Issue has been confirmed by VS Code Team member feature-request Request for new features or functionality file-io File I/O help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@bpasero @przemolb @rzhao271 and others