rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
5.93k stars 866 forks source link

Support helping editors maintain marks and positions #3261

Open da-x opened 5 years ago

da-x commented 5 years ago

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?

lukeyeh commented 3 years ago

Hello is this still a relevant issue, I would be interested in working on this!