Skip to content

feature request: add option code_actions to format_on_save #810

@ras0q

Description

@ras0q

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

Currently, conform.nvim provides a highly convenient format_on_save option.

I propose adding a configuration option to conform.nvim that allows users to specify a list of LSP Code Action Kinds to be executed immediately prior to or during the format_on_save process. This feature would align with a common functionality found in popular editors, such as VS Code's "Code Actions on Save".

require("conform").setup({
  format_on_save = {
    -- These options will be passed to conform.format()
    timeout_ms = 500,
    lsp_format = "fallback",
    code_actions = { "source.organizeImports", "source.fixAll" }, -- ← new!
  },
})

Provide background

No response

What is the significance of this feature?

nice to have

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions