stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
2.89k stars 150 forks source link

fix(rustfmt): use Cargo.toml settings and default to recent edition #328

Closed stevearc closed 6 months ago

stevearc commented 6 months ago

An alternative to #321 closes #320

riftsin commented 6 months ago

Oh that's really cool, looks better than #321. Question, does the ctx passed on lua/conform/formatters/rustfmt.lua:12 refers to the current buffer ? (learning :) )

stevearc commented 6 months ago

Yes, the ctx is created for the specific buffer being formatted. You can find the definition of that object here: https://github.com/stevearc/conform.nvim/blob/db2c697fe8302f0328b50b480204be1b577a1e2f/lua/conform/init.lua#L47-L51