Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--docs/book/README.md2
-rw-r--r--docs/book/src/contributing/README.md11
-rw-r--r--docs/book/src/contributing/debugging.md2
-rw-r--r--docs/book/src/installation.md4
-rw-r--r--docs/book/src/rust_analyzer_binary.md26
-rw-r--r--docs/book/src/troubleshooting.md10
-rw-r--r--docs/book/src/vs_code.md15
7 files changed, 44 insertions, 26 deletions
diff --git a/docs/book/README.md b/docs/book/README.md
index 0a3161f3af..cd4d8783a4 100644
--- a/docs/book/README.md
+++ b/docs/book/README.md
@@ -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
diff --git a/docs/book/src/contributing/README.md b/docs/book/src/contributing/README.md
index c95a1dba62..bb2b6081ad 100644
--- a/docs/book/src/contributing/README.md
+++ b/docs/book/src/contributing/README.md
@@ -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
```
diff --git a/docs/book/src/contributing/debugging.md b/docs/book/src/contributing/debugging.md
index fcda664f5e..ace9be025a 100644
--- a/docs/book/src/contributing/debugging.md
+++ b/docs/book/src/contributing/debugging.md
@@ -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
```
diff --git a/docs/book/src/installation.md b/docs/book/src/installation.md
index 3a4c0cf227..cc636c31e6 100644
--- a/docs/book/src/installation.md
+++ b/docs/book/src/installation.md
@@ -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
diff --git a/docs/book/src/rust_analyzer_binary.md b/docs/book/src/rust_analyzer_binary.md
index c7ac3087ce..2b62011a8e 100644
--- a/docs/book/src/rust_analyzer_binary.md
+++ b/docs/book/src/rust_analyzer_binary.md
@@ -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,10 @@ 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
+```bash
+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 +42,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 +59,9 @@ User Repository):
Install it with pacman, for example:
- $ pacman -S rust-analyzer
+```bash
+pacman -S rust-analyzer
+```
### Gentoo Linux
@@ -64,7 +72,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
diff --git a/docs/book/src/troubleshooting.md b/docs/book/src/troubleshooting.md
index a357cbef41..c315bfad7f 100644
--- a/docs/book/src/troubleshooting.md
+++ b/docs/book/src/troubleshooting.md
@@ -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.
diff --git a/docs/book/src/vs_code.md b/docs/book/src/vs_code.md
index 233b862d2c..75f940e69a 100644
--- a/docs/book/src/vs_code.md
+++ b/docs/book/src/vs_code.md
@@ -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.
-