Skip to content

Provide better completion for editor.codeActionsOnSave #161284

Closed

Description

Currently, when user configure editor.codeActionsOnSave, this is what user sees.
image

It basically promotes users to write "source.fixAll": true if user wants any fix all to run on save.

problem is it assumes there is only 1 kind of source.fixAll from an extension. but like refactor has refactor.extract, refactor.inline and etc, one extension can provide multiple kinds of fix all code actions.

for example, pylance provides 2 fix all (and plan to add more)

  • source.fixAll.unusedImports
  • source.fixAll.convertImportFormat

but in current user experience, source.fixAll: true basically catch all option. any new fix all added will automatically picked up and run.

so, user basically need to check documentation every time when new version is released for extensions and check new fix all added and disable them if they don't want them.

It would be better if it works the other way around and "editor.codeActionsOnSave" actually show all fix all codeActions in completion so that user can enable each specific fix all they want rather than enable all and disable each specific one.

by the way, I see other extension such as eslint, tslint, stylelint, markdownlint's vscode extension expose only 1 fix all code action and use its own option to control what fix are run on fix all and apply them themselves.

if that is how it is supposed to work, it would be nice to document that in vscode doc and enforce to have only 1 fix all code action.

but even so, showing each fix all kind from each extension should still benefit users in case they want to disable fix all provider of an extension.

Activity

  1. heejaechang commented on Sep 19, 2022

    @heejaechang
    Author

    related item - #82718

  2. heejaechang commented on Sep 19, 2022

    @heejaechang
    Author

    and this is how VS works

    codecleanup

  3. added this to the Backlog milestone on Sep 21, 2022
  4. added
    feature-request
    editor-code-actions
    on Sep 22, 2022
  5. added
    help wanted
    on Dec 8, 2022
  6. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Jun 24, 2024
  7. locked and limited conversation to collaborators on Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-code-actionsfeature-requesthelp wantedinsiders-releasedon-testplan

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions