stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
3.1k stars 163 forks source link

bug: rust async code formatting error #320

Closed tianyax closed 7 months ago

tianyax commented 7 months ago

Neovim version (nvim -v)

v0.10.0-dev-2021+gee2127363

Operating system/version

macos 14

Add the debug logs

Log file

image

Describe the bug

rust async code formatting errors when using rustfmt; shouldn't we add the parameter --edition 2021?

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. nvim main.rs
  2. format the async code

Expected Behavior

rustfmt support async code

Minimal example file

No response

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        -- add your config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response