go.nvim icon indicating copy to clipboard operation
go.nvim copied to clipboard

how to use goimports-reviser instead of goimports

Open roychoo opened this issue 1 year ago • 2 comments

Hi, wish to use https://github.com/incu6us/goimports-reviser instead of goimports, how could i configure it? it tried

goimports = goimports-reviser

but it is not working

roychoo avatar Dec 17 '23 07:12 roychoo

I have not used goimports-reviser. Are there errors? Also are goimports and goimports-reviser compatible?

ray-x avatar Dec 17 '23 11:12 ray-x

I also have similar problem.

I just put this logic inside the formatter plugin, but it would be great if we can support it inside your plugin:

    go = {
      function()
        return {
          exe = "goimports-reviser",
          args = {
            "-output",
            "stdout",
            "-rm-unused",
            util.escape_path(util.get_current_buffer_file_path()),
          },
          stdin = true,
        }
      end,
      require("formatter.filetypes.go").gofumpt,
      require("formatter.filetypes.go").golines,
    },

mortymacs avatar Feb 13 '24 11:02 mortymacs