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

feature: A way to set "always" as conform "lsp_fallback" #1790

Closed
1 task done
igorgue opened this issue Oct 18, 2023 · 0 comments · Fixed by #1800 or #1808
Closed
1 task done

feature: A way to set "always" as conform "lsp_fallback" #1790

igorgue opened this issue Oct 18, 2023 · 0 comments · Fixed by #1800 or #1808
Labels
enhancement New feature or request

Comments

@igorgue
Copy link

igorgue commented Oct 18, 2023

Did you check the docs?

  • I have read all the LazyVim docs

Is your feature request related to a problem? Please describe.

It's currently impossible to pass from opts the formatting options which leaves lsp_fallback to "true" but I'd like to set it up as "always" currently I have to override the init function of the spec:

    init = function()
      local conform_opts = {
        format = {
          timeout_ms = 5000,
          async = false,
          lsp_fallback = "always",
          quiet = true,
        },
      }

      -- Install the conform formatter on VeryLazy
      require("lazyvim.util").on_very_lazy(function()
        require("lazyvim.util").format.register({
          name = "conform.nvim",
          priority = 100,
          primary = true,
          format = function(buf)
            require("conform").format(Util.merge(conform_opts.format, { bufnr = buf }))
          end,
          sources = function(buf)
            local ret = require("conform").list_formatters(buf)
            ---@param v conform.FormatterInfo
            return vim.tbl_map(function(v)
              return v.name
            end, ret)
          end,
        })
      end)

Describe the solution you'd like

Can you make it so I can change it from opts?

Describe alternatives you've considered

Replace init fn

Additional context

No response

@igorgue igorgue added the enhancement New feature or request label Oct 18, 2023
@folke folke closed this as completed in ea3155a Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant