-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustfmt override no longer works as a relative path #15595
Labels
C-bug
Category: bug
Comments
Crap, I'm sorry about that. I'll put up a PR and test it against rustc. I'll proceed under the assumption that I'll need to bootstrap |
You just need to check out rustc and open it in vscode + RA with the config suggested in the dev guide, and try to format some files. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 16, 2023
…, r=compiler-errors update rust_analyzer_settings.json This works around rust-lang/rust-analyzer#15595, and avoids relying on the unspecified working directory of this command.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Sep 16, 2023
…on, r=compiler-errors update rust_analyzer_settings.json This works around rust-lang/rust-analyzer#15595, and avoids relying on the unspecified working directory of this command.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 16, 2023
Rollup merge of rust-lang#115836 - RalfJung:rust_analyzer_settings.json, r=compiler-errors update rust_analyzer_settings.json This works around rust-lang/rust-analyzer#15595, and avoids relying on the unspecified working directory of this command.
bors
added a commit
that referenced
this issue
Oct 6, 2023
…r=Veykril fix: ensure `rustfmt` runs when configured with `./` (Hopefully) resolves #15595. This change kinda approaches canonicalization—which I am not a fan of—but only in service of making `./`-configured commands run correctly. Longer-term, I feel like this code should be removed once `rustfmt` supports recursive searches of configuration files or interpolation of values like `${workspace_folder}` lands in rust-analyzer. ## Testing I cloned `rustc`, setup rust-analyzer as suggested in the [`rustc` dev guide](https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc), saved and formatted files in `src/tools/miri` and `compiler`, and saw `rustfmt` (seemingly) correctly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid #15564 has caused new problems... rustfmt doesn't work in the rustc workspace at all any more. The override is
and now this is interpreted relative to the directory the file is in, which of course does not work.
Probably this could be fixed by having RA do
workspace_dir.join(rustfmt_path)
so that it doesn't rely on a relative directory any more.rust-analyzer version: rust-analyzer version: 0.3.1657-standalone
The text was updated successfully, but these errors were encountered: