Skip to content

Conversation

davidbarsky
Copy link
Contributor

Introduction

Resolves #15540. I moved the chdir functionality outside of the match to ensure that this functionality wouldn’t fall through again. As part of this PR, I also changed from_proto::file_range to accept a TextDocumentIdentifier by reference instead of by value, but I can undo this change if desired.

Testing

I added a rustfmt.toml will the contents below at crates/rust-analyzer/rustfmt.toml:


reorder_modules = false
use_small_heuristics = "Max"
# this is the only difference from the `rustfmt.toml` at the root of the repo
tab_spaces = 8

In addition, I've also added "rust-analyzer.rustfmt.overrideCommand": ["rustfmt"] to my VS Code configuration.

With the above changes, saving crates/rust-analyzer/src/handlers/request.rs results in 8-space indentation. Meanwhile, saving crates/toolchain/src/lib.rs does not result in any formatting changes.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 6, 2023
@Veykril
Copy link
Member

Veykril commented Sep 6, 2023

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Sep 6, 2023

📌 Commit 42f77f8 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 6, 2023

⌛ Testing commit 42f77f8 with merge a843e46...

@bors
Copy link
Contributor

bors commented Sep 6, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing a843e46 to master...

@bors bors merged commit a843e46 into rust-lang:master Sep 6, 2023
@davidbarsky davidbarsky deleted the davidbarsky/use-current-subcrates-rustfmt-toml-with-custom-command branch September 6, 2023 20:37
@RalfJung
Copy link
Member

I'm afraid this has caused new problems: #15595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invoking rustfmt uses the project-wide rustfmt.toml, not the one for the current subcrate
5 participants