docs: beginnings of an 'editor setup' section

This commit is contained in:
Emily 2024-11-09 02:13:28 +01:00
parent ce3436b92b
commit 235d57c053
2 changed files with 52 additions and 0 deletions

2
.gitignore vendored
View file

@ -11,6 +11,8 @@ result
# Editor specific ignores
.idea
.vscode
.zed
# Generated by setting `JJ_TRACE` environment variable.
jj-trace-*.json

View file

@ -216,6 +216,56 @@ to use" instructions](https://github.com/rui314/mold#how-to-use).
On recent versions of MacOS, the default linker Rust uses is already
multi-threaded. It should use all the CPU cores without any configuration.
### Editor setup
#### Visual Studio Code
We recommend at least these settings:
```js
{
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"[rust]": {
"files.trimTrailingWhitespace": false
}
}
```
#### Zed
```js
// .zed/settings.json
{
"ensure_final_newline_on_save": true,
"remove_trailing_whitespace_on_save": true,
"languages": {
// We don't use a formatter for Markdown files, so format_on_save would just
// mess with others' docs
"Markdown": { "format_on_save": "off" }
"Rust": {
"format_on_save": "on",
// Avoid removing trailing spaces within multi-line string literals
"remove_trailing_whitespace_on_save": false
}
},
"lsp": {
"rust-analyzer": {
"initialization_options": {
// If you are working on docs and don't need `cargo check`, uncomment
// this option:
//
// "checkOnSave": false,
// Use nightly `rustfmt`, equivalent to `cargo +nightly fmt`
"rustfmt": { "extraArgs": ["+nightly"] }
}
}
}
}
```
## Previewing the HTML documentation