3
3
rust-analyzer is an ordinary Rust project, which is organized as a Cargo workspace, builds on stable and doesn't depend on C libraries.
4
4
So, just
5
5
6
- ```
6
+ ``` bash
7
7
$ cargo test
8
8
```
9
9
@@ -140,15 +140,15 @@ By default, log goes to stderr, but the stderr itself is processed by VS Code.
140
140
` --log-file <PATH> ` CLI argument allows logging to file.
141
141
Setting the ` RA_LOG_FILE=<PATH> ` environment variable will also log to file, it will also override ` --log-file ` .
142
142
143
- To see stderr in the running VS Code instance, go to the "Output" tab of the panel and select ` rust-analyzer ` .
143
+ To see stderr in the running VS Code instance, go to the "Output" tab of the panel and select ` Rust Analyzer Client ` .
144
144
This shows ` eprintln! ` as well.
145
145
Note that ` stdout ` is used for the actual protocol, so ` println! ` will break things.
146
146
147
147
To log all communication between the server and the client, there are two choices:
148
148
149
149
* You can log on the server side, by running something like
150
150
151
- ```
151
+ ``` bash
152
152
env RA_LOG=lsp_server=debug code .
153
153
```
154
154
@@ -180,7 +180,7 @@ There are also several VS Code commands which might be of interest:
180
180
181
181
We have a built-in hierarchical profiler, you can enable it by using ` RA_PROFILE ` env-var:
182
182
183
- ```
183
+ ``` bash
184
184
RA_PROFILE=* // dump everything
185
185
RA_PROFILE=foo| bar| baz // enabled only selected entries
186
186
RA_PROFILE=* @3> 10 // dump everything, up to depth 3, if it takes more than 10 ms
@@ -191,7 +191,7 @@ Some rust-analyzer contributors have `export RA_PROFILE='*>10'` in my shell prof
191
191
For machine-readable JSON output, we have the ` RA_PROFILE_JSON` env variable. We support
192
192
filtering only by span name:
193
193
194
- ```
194
+ ` ` ` bash
195
195
RA_PROFILE=* // dump everything
196
196
RA_PROFILE_JSON=" vfs_load|parallel_prime_caches|discover_command" // dump selected spans
197
197
` ` `
@@ -201,13 +201,13 @@ It is enabled by `RA_COUNT=1`.
201
201
202
202
To measure time for from-scratch analysis, use something like this:
203
203
204
- ```
204
+ ` ` ` bash
205
205
$ cargo run --release -p rust-analyzer -- analysis-stats ../chalk/
206
206
` ` `
207
207
208
208
For measuring time of incremental analysis, use either of these:
209
209
210
- ```
210
+ ` ` ` bash
211
211
$ cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --highlight ../chalk/chalk-engine/src/logic.rs
212
212
$ cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --complete ../chalk/chalk-engine/src/logic.rs:94:0
213
213
` ` `
@@ -220,7 +220,7 @@ Release process is handled by `release`, `dist`, `publish-release-notes` and `pr
220
220
221
221
` release` assumes that you have checkouts of ` rust-analyzer` , ` rust-analyzer.github.io` , and ` rust-lang/rust` in the same directory:
222
222
223
- ```
223
+ ` ` ` bash
224
224
./rust-analyzer
225
225
./rust-analyzer.github.io
226
226
./rust-rust-analyzer # Note the name!
0 commit comments