]> git.lizzy.rs Git - rust.git/commitdiff
Merge #8767
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Tue, 25 May 2021 12:15:48 +0000 (12:15 +0000)
committerGitHub <noreply@github.com>
Tue, 25 May 2021 12:15:48 +0000 (12:15 +0000)
8767: implement range formatting r=matklad a=euclio

Fixes #7580.

This PR implements the `textDocument/rangeFormatting` request using `rustfmt`'s `--file-lines` option.

Still needs some tests. What I want to know is how I should handle the instability of the `--file-lines` option. It's still unstable in rustfmt, so it's only available on nightly, and needs a special flag to enable. Is there a way for `rust-analyzer` to detect if it's using nightly rustfmt, or for users to opt-in?

Co-authored-by: Andy Russell <arussell123@gmail.com>
1  2 
crates/rust-analyzer/src/config.rs
crates/rust-analyzer/src/handlers.rs
crates/rust-analyzer/src/main_loop.rs

Simple merge
Simple merge
Simple merge