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

fix: improve settings descriptions for actions triggered on save #230052

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

elias-pap
Copy link

closes #230051

@elias-pap
Copy link
Author

@microsoft-github-policy-service agree

@elias-pap elias-pap marked this pull request as ready for review September 28, 2024 18:32
Copy link
Contributor

@justschen justschen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also take a look at editor.codeActions.triggerOnFocusChange, which will save in certain scenarios:

  1. auto save is afterDelay
  2. editor code actions on save are set to always.
  3. focus is changed

note that this only works atm for editor code actions on save, and not notebooks.

@@ -64,7 +64,7 @@ const codeActionsOnSaveSchema: IConfigurationPropertySchema = {
items: { type: 'string' }
}
],
markdownDescription: nls.localize('editor.codeActionsOnSave', 'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'),
markdownDescription: nls.localize('editor.codeActionsOnSave', 'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. When [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) is set to `afterDelay`, Code Actions will run when the file is saved explicitly, not when saved automatically. Example: `"source.organizeImports": "explicit" `'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this and all cases below, instead of pointing towards documentation, please point it towards the auto save setting

Copy link
Contributor

@justschen justschen Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: change to ....will only be run when the file is saved explicitly.

Copy link
Author

@elias-pap elias-pap Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 2de9ac0 and 242ad96.

@elias-pap elias-pap changed the title fix: improve settings descriptions for actions trigged on save fix: improve settings descriptions for actions triggered on save Oct 11, 2024
@elias-pap elias-pap force-pushed the improve-settings-descriptions branch from 22bef86 to 2de9ac0 Compare October 11, 2024 22:18
@elias-pap
Copy link
Author

elias-pap commented Oct 11, 2024

Please also take a look at editor.codeActions.triggerOnFocusChange, which will save in certain scenarios:

Not sure what you mean. This setting does not "save" in certain scenarios, it only triggers the code actions under some conditions, one of them being auto save is set to afterDelay. So the save happens automatically after delay, not from this setting. Also, the code actions run automatically, but not because (or at the time of) the editor is being saved.

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 this pull request may close these issues.

Confusing settings descriptions about actions and auto save
5 participants