docs: remove shell prompt symbols and fix code block languages
This commit is contained in:
parent
492e3027a6
commit
51abdcaaf5
7 changed files with 40 additions and 26 deletions
|
|
@ -6,7 +6,7 @@ The rust analyzer manual uses [mdbook](https://rust-lang.github.io/mdBook/).
|
|||
|
||||
To run the documentation site locally:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
cargo install mdbook
|
||||
cargo xtask codegen
|
||||
cd docs/book
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ rust-analyzer is an ordinary Rust project, which is organized as a Cargo workspa
|
|||
So, just
|
||||
|
||||
```bash
|
||||
$ cargo test
|
||||
cargo test
|
||||
```
|
||||
|
||||
should be enough to get you started!
|
||||
|
|
@ -203,14 +203,14 @@ It is enabled by `RA_COUNT=1`.
|
|||
To measure time for from-scratch analysis, use something like this:
|
||||
|
||||
```bash
|
||||
$ cargo run --release -p rust-analyzer -- analysis-stats ../chalk/
|
||||
cargo run --release -p rust-analyzer -- analysis-stats ../chalk/
|
||||
```
|
||||
|
||||
For measuring time of incremental analysis, use either of these:
|
||||
|
||||
```bash
|
||||
$ cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --highlight ../chalk/chalk-engine/src/logic.rs
|
||||
$ cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --complete ../chalk/chalk-engine/src/logic.rs:94:0
|
||||
cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --highlight ../chalk/chalk-engine/src/logic.rs
|
||||
cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --complete ../chalk/chalk-engine/src/logic.rs:94:0
|
||||
```
|
||||
|
||||
Look for `fn benchmark_xxx` tests for a quick way to reproduce performance problems.
|
||||
|
|
@ -283,7 +283,8 @@ repository. We use the [rustc-josh-sync](https://github.com/rust-lang/josh-sync)
|
|||
repositories. You can find documentation of the tool [here](https://github.com/rust-lang/josh-sync).
|
||||
|
||||
You can install the synchronization tool using the following commands:
|
||||
```
|
||||
|
||||
```bash
|
||||
cargo install --locked --git https://github.com/rust-lang/josh-sync
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ while d == 4 { // set a breakpoint here and change the value
|
|||
|
||||
However for this to work, you will need to enable debug_assertions in your build
|
||||
|
||||
```rust
|
||||
```bash
|
||||
RUSTFLAGS='--cfg debug_assertions' cargo build --release
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ editor](./other_editors.html).
|
|||
rust-analyzer will attempt to install the standard library source code
|
||||
automatically. You can also install it manually with `rustup`.
|
||||
|
||||
$ rustup component add rust-src
|
||||
```bash
|
||||
rustup component add rust-src
|
||||
```
|
||||
|
||||
Only the latest stable standard library source is officially supported
|
||||
for use with rust-analyzer. If you are using an older toolchain or have
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@ your `$PATH`.
|
|||
On Linux to install the `rust-analyzer` binary into `~/.local/bin`,
|
||||
these commands should work:
|
||||
|
||||
$ mkdir -p ~/.local/bin
|
||||
$ curl -L https://github.com/rust-lang/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
|
||||
$ chmod +x ~/.local/bin/rust-analyzer
|
||||
```bash
|
||||
mkdir -p ~/.local/bin
|
||||
curl -L https://github.com/rust-lang/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
|
||||
chmod +x ~/.local/bin/rust-analyzer
|
||||
```
|
||||
|
||||
Make sure that `~/.local/bin` is listed in the `$PATH` variable and use
|
||||
the appropriate URL if you’re not on a `x86-64` system.
|
||||
|
|
@ -24,8 +26,8 @@ or `/usr/local/bin` will work just as well.
|
|||
Alternatively, you can install it from source using the command below.
|
||||
You’ll need the latest stable version of the Rust toolchain.
|
||||
|
||||
$ git clone https://github.com/rust-lang/rust-analyzer.git && cd rust-analyzer
|
||||
$ cargo xtask install --server
|
||||
git clone https://github.com/rust-lang/rust-analyzer.git && cd rust-analyzer
|
||||
cargo xtask install --server
|
||||
|
||||
If your editor can’t find the binary even though the binary is on your
|
||||
`$PATH`, the likely explanation is that it doesn’t see the same `$PATH`
|
||||
|
|
@ -38,7 +40,9 @@ the environment should help.
|
|||
|
||||
`rust-analyzer` is available in `rustup`:
|
||||
|
||||
$ rustup component add rust-analyzer
|
||||
```bash
|
||||
rustup component add rust-analyzer
|
||||
```
|
||||
|
||||
### Arch Linux
|
||||
|
||||
|
|
@ -53,7 +57,7 @@ User Repository):
|
|||
|
||||
Install it with pacman, for example:
|
||||
|
||||
$ pacman -S rust-analyzer
|
||||
pacman -S rust-analyzer
|
||||
|
||||
### Gentoo Linux
|
||||
|
||||
|
|
@ -64,7 +68,9 @@ Install it with pacman, for example:
|
|||
The `rust-analyzer` binary can be installed via
|
||||
[Homebrew](https://brew.sh/).
|
||||
|
||||
$ brew install rust-analyzer
|
||||
```bash
|
||||
brew install rust-analyzer
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@ bypassing LSP machinery.
|
|||
When filing issues, it is useful (but not necessary) to try to minimize
|
||||
examples. An ideal bug reproduction looks like this:
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/username/repo.git && cd repo && git switch --detach commit-hash
|
||||
$ rust-analyzer --version
|
||||
```bash
|
||||
git clone https://github.com/username/repo.git && cd repo && git switch --detach commit-hash
|
||||
rust-analyzer --version
|
||||
rust-analyzer dd12184e4 2021-05-08 dev
|
||||
$ rust-analyzer analysis-stats .
|
||||
💀 💀 💀
|
||||
rust-analyzer analysis-stats .
|
||||
```
|
||||
💀 💀 💀
|
||||
|
||||
It is especially useful when the `repo` doesn’t use external crates or
|
||||
the standard library.
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ Alternatively, download a VSIX corresponding to your platform from the
|
|||
Install the extension with the `Extensions: Install from VSIX` command
|
||||
within VS Code, or from the command line via:
|
||||
|
||||
$ code --install-extension /path/to/rust-analyzer.vsix
|
||||
```bash
|
||||
code --install-extension /path/to/rust-analyzer.vsix
|
||||
```
|
||||
|
||||
If you are running an unsupported platform, you can install
|
||||
`rust-analyzer-no-server.vsix` and compile or obtain a server binary.
|
||||
|
|
@ -64,8 +66,10 @@ example:
|
|||
|
||||
Both the server and the Code plugin can be installed from source:
|
||||
|
||||
$ git clone https://github.com/rust-lang/rust-analyzer.git && cd rust-analyzer
|
||||
$ cargo xtask install
|
||||
```bash
|
||||
git clone https://github.com/rust-lang/rust-analyzer.git && cd rust-analyzer
|
||||
cargo xtask install
|
||||
```
|
||||
|
||||
You’ll need Cargo, nodejs (matching a supported version of VS Code) and
|
||||
npm for this.
|
||||
|
|
@ -76,7 +80,9 @@ Remote, instead you’ll need to install the `.vsix` manually.
|
|||
If you’re not using Code, you can compile and install only the LSP
|
||||
server:
|
||||
|
||||
$ cargo xtask install --server
|
||||
```bash
|
||||
cargo xtask install --server
|
||||
```
|
||||
|
||||
Make sure that `.cargo/bin` is in `$PATH` and precedes paths where
|
||||
`rust-analyzer` may also be installed. Specifically, `rustup` includes a
|
||||
|
|
@ -118,4 +124,3 @@ steps might help:
|
|||
|
||||
A C compiler should already be available via `org.freedesktop.Sdk`. Any
|
||||
other tools or libraries you will need to acquire from Flatpak.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue