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

Make "editor.codeActionsOnSave" a resource setting #84288

Closed
dbaeumer opened this issue Nov 8, 2019 · 5 comments
Closed

Make "editor.codeActionsOnSave" a resource setting #84288

dbaeumer opened this issue Nov 8, 2019 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Nov 8, 2019

Currently the setting "editor.codeActionsOnSave" is not defined as a resource setting and therefore can't be overriden on a folder level.

However to migrate existing willSave handlers to code actions on save it would be very helpful if the setting can be overridden on a folder level as well. Then for ESLint I would add something like this to the settings:

"editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
}

which will enable source fix all for eslint.

Without this I need to tell users that they have to maintain to settings one eslint specific and the "editor.codeActionsOnSave" to enable / disable this.

@dbaeumer
Copy link
Member Author

dbaeumer commented Nov 8, 2019

/cc @jrieken

@dbaeumer
Copy link
Member Author

dbaeumer commented Nov 8, 2019

More background: I wanted to use this setting to allow users to configure whether eslint auto fix on save is enabled or not. I can easily see use cases where this is enabled for eslint for a workspace folder A but disabled for a workspace folder B. This is currently supported for the eslint specific setting eslint.autoFixOnSave which I wanted to migrate to the new editor.codeActionsOnSave.

@dbaeumer
Copy link
Member Author

dbaeumer commented Nov 8, 2019

Actually the setting is read here:

https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/api/browser/mainThreadSaveParticipant.ts#L260

So I think it would make perfect sense to declare the settings as a resource setting since it is always read relative to a resource.

@mattbierner any objection if I change this in VS Code source code.

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 8, 2019

No, I think this was just an oversight. Making it a resource setting sounds good

@mjbvz mjbvz added this to the November 2019 milestone Nov 8, 2019
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Nov 8, 2019
@mjbvz mjbvz closed this as completed in f44dc08 Nov 8, 2019
@dbaeumer
Copy link
Member Author

Thanks for addressing this so quickly.

@RMacfarlane RMacfarlane added the verified Verification succeeded label Dec 4, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants