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

Confusing settings descriptions about actions and auto save #230051

Open
elias-pap opened this issue Sep 28, 2024 · 1 comment · May be fixed by #230052
Open

Confusing settings descriptions about actions and auto save #230051

elias-pap opened this issue Sep 28, 2024 · 1 comment · May be fixed by #230052
Assignees

Comments

@elias-pap
Copy link

The problem

In VSCode settings, editor.formatOnSave setting has the following description:

Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down.

"the file must not be saved after delay" part made me assume that the format on save feature will never work when files.autoSave is set to afterDelay.
But that's not true because the formatting is still applied when the file is saved explicitly.

I understand that what you're trying to communicate is that the formatting won't be applied automatically, when the file is saved automatically. But it can still be applied manually when the file is explicitly saved.

The same is true for the descriptions of notebook.formatOnSave and notebook.codeActionsOnSave settings. editor.codeActionsOnSave is an outlier since it doesn't contain that part in the description, but the same is true for this option as well, so it can be updated for consistency.

Attaching related screencasts, to demonstrate.

editor.formatOnSave with auto save set to "off":

auto-save-off-file-format.mov

editor.formatOnSave with auto save set to "afterDelay":

auto-save-on-file-format.mov

Does this issue occur when all extensions are disabled?

Yes

System info

  • VS Code Version: 1.93.1 (Universal)
  • OS Version: Darwin arm64 23.6.0
Version: 1.93.1 (Universal)
Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Date: 2024-09-11T17:20:05.685Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0

Steps to Reproduce:

You can try to reproduce what is depicted in the second video above.

  1. Set editor.defaultFormatter setting to vscode.typescript-language-features.
  2. Enable editor.formatOnSave setting.
  3. Set files.autoSave to afterDelay.
  4. Open a TypeScript file, e.g. https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/files/browser/files.contribution.ts
  5. Make a whitespace change, e.g. add a few spaces to the end of a line.
  6. Save the file manually.

The file is not auto-formatted after step 5 even though the file is auto saved, but it is after step 6 (the whitespace added in step 5 is gone).

@elias-pap
Copy link
Author

elias-pap commented Sep 28, 2024

Attaching additional screencasts for the rest of the cases.

editor.codeActionsOnSave - auto save set to "off" (unused import deleted after manual save)
auto-save-off-file-code-actions.mov
editor.codeActionsOnSave - auto save set to "afterDelay" (unused import deleted after manual save)
auto-save-on-file-code-actions.mov
notebook.formatOnSave - auto save set to "off"
auto-save-off-py-notebook-format.mov
notebook.formatOnSave - auto save set to "afterDelay"
auto-save-on-py-notebook-format.mov
notebook.codeActionsOnSave - auto save set to "off" (unused import deleted after manual save)
auto-save-off-py-notebook-code-actions.mov
notebook.codeActionsOnSave - auto save set to "afterDelay" (unused import deleted after manual save)
auto-save-on-py-notebook-code-actions.mov

@elias-pap elias-pap changed the title Confusing settings descriptions about actions on auto save Confusing settings descriptions about actions and auto save Sep 28, 2024
@rzhao271 rzhao271 assigned Yoyokrazy and justschen and unassigned rzhao271 Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants