Skip to content

Commit b4c4652

Browse files
authored
Replace settings.json with x.py setup note (rust-lang#1588)
1 parent a80f180 commit b4c4652

File tree

1 file changed

+5
-36
lines changed

1 file changed

+5
-36
lines changed

src/building/suggested.md

+5-36
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,17 @@ You can also install the hook as a step of running `./x.py setup`!
2222
`rust-analyzer` can help you check and format your code whenever you save
2323
a file. By default, `rust-analyzer` runs the `cargo check` and `rustfmt`
2424
commands, but you can override these commands to use more adapted versions
25-
of these tools when hacking on `rustc`. For example, for Visual Studio Code,
26-
you can write: <!-- date-check: nov 2022 --><!-- the date comment is for the edition below -->
27-
28-
```JSON
29-
{
30-
"rust-analyzer.checkOnSave.overrideCommand": [
31-
"python3",
32-
"x.py",
33-
"check",
34-
"--json-output"
35-
],
36-
"rust-analyzer.rustfmt.overrideCommand": [
37-
"./build/host/rustfmt/bin/rustfmt",
38-
"--edition=2021"
39-
],
40-
"rust-analyzer.procMacro.server": "./build/host/stage0/libexec/rust-analyzer-proc-macro-srv",
41-
"rust-analyzer.procMacro.enable": true,
42-
"rust-analyzer.cargo.buildScripts.enable": true,
43-
"rust-analyzer.cargo.buildScripts.invocationLocation": "root",
44-
"rust-analyzer.cargo.buildScripts.invocationStrategy": "once",
45-
"rust-analyzer.cargo.buildScripts.overrideCommand": [
46-
"python3",
47-
"x.py",
48-
"check",
49-
"--json-output"
50-
],
51-
"rust-analyzer.cargo.sysroot": "./build/host/stage0-sysroot",
52-
"rust-analyzer.rustc.source": "./Cargo.toml",
53-
}
54-
```
55-
56-
in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use
57-
`./x.py check` to check the sources, and the stage 0 rustfmt to format them.
25+
of these tools when hacking on `rustc`. For example, `x.py setup` will prompt
26+
you to create a `.vscode/settings.json` file which will configure Visual Studio code.
27+
This will ask `rust-analyzer` to use `./x.py check` to check the sources, and the
28+
stage 0 rustfmt to format them.
5829

5930
If you have enough free disk space and you would like to be able to run `x.py` commands while
6031
rust-analyzer runs in the background, you can also add `--build-dir build-rust-analyzer` to the
6132
`overrideCommand` to avoid x.py locking.
6233

6334
If you're running `coc.nvim`, you can use `:CocLocalConfig` to create a
64-
`.vim/coc-settings.json` and enter the same settings as above, but replacing
65-
`editor.formatOnSave: true,` with
66-
`"coc.preferences.formatOnSaveFiletypes": ["rust"],`.
35+
`.vim/coc-settings.json` and copy the settings from [this file](https://github.com/rust-lang/rust/blob/master/src/etc/vscode_settings.json).
6736

6837
If running `./x.py check` on save is inconvenient, in VS Code you can use a [Build
6938
Task] instead:

0 commit comments

Comments
 (0)