This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Better Rustfmt integration #3
Closed
Description
RLS currently supports rudimentary Rustfmt integration. It could be improved a lot:
- currently errors if any sub-modules are present and the file is not saved to disk (stdin formatting fails if mod file not found rustfmt#562)
- we currently return the entire re-formatted file, it would be better to return the ranges modified and the new text (and also update the VFS with that) (blocked on API that returns the ranges modified rustfmt#1173)
- If there are no changes, don't change anything (Allow reformat to be a no-op #334). Rustfmt sort of has the facility to tell us this, but it is not exposed in the mode we need. Could be fixed by the diff approach, but might be easier to add as step towards that.
- allow formatting line ranges (Format ranges #333) (VSCode has a provider for this, but blocked on file_lines with a comment is broken rustfmt#1159)
- add a format-on-save option (apparently this should Just Work, need to document)
- take the indent-width hint from VSCode and pass it to Rustfmt (but don't override the user's setting, if set in rustfmt.toml)
- use the user's rustfmt.toml (Support formatting config via rustfmt.toml #331)
- Formatting adds newline at the end on file on each format (Formatting adds newline at the end on file on each format #282)
- Formatting seems to be broken? (Formatting seems to be broken? #242)
Metadata
Metadata
Assignees
Labels
No labels