Running a reformatter from the context of an editor, raises the expectation that the editor will not lose its cursor position, marks, various highlights, and more.
However, only rustfmt can reliably relate between pre-reformatting and post-reformatting token positions, being that it performs the reformatting. Perhaps a list of token positions can be passed as input to rustfmt, and then their new positions can outputted?
To continue what I've written up in https://github.com/rust-lang/rust.vim/issues/287 :
Running a reformatter from the context of an editor, raises the expectation that the editor will not lose its cursor position, marks, various highlights, and more.
However, only rustfmt can reliably relate between pre-reformatting and post-reformatting token positions, being that it performs the reformatting. Perhaps a list of token positions can be passed as input to
rustfmt
, and then their new positions can outputted?