Skip to content

Allow editor.codeActionsOnSave for autoSave afterDelay #200881

@justschen

Description

@justschen

cc. @bpasero @alexdima

From another conversation:

I have "files.autoSave": "afterDelay" and that seems to never run code actions. So every time I make changes, right before committing them, I need to manually click through each file, click on the right and press cmd+s to organize imports.

so I would love to run code actions perhaps on focus change or something, it just feels I don’t benefit at all from code actions on save, so I need to constantly run them manually

ATM, code actions on save already work for auto saves on focus change and window change, but not on auto saves. With the addition of being able to configure autoSave more granularly, can maybe consider adding back allowing code actions to run on auto save if the delay is significant enough.

Additional things to consider:

  • When this is enabled:
  • allow to skip auto save when the file has error markers

  • Will auto save be run on warnings (ie, imports that have not been used yet, linting), or is it limited to just errors?
  • If it doesn't run when there are warnings/errors, then auto save after delay would work perfectly and not accidentally delete imports that are recently added.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insidersunder-discussionIssue is under discussion for relevance, priority, approachverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions