mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:17:13 +00:00
Improve contributing/README.md
This commit is contained in:
parent
8d7cda373b
commit
98f2cfd3fa
@ -3,7 +3,7 @@
|
||||
rust-analyzer is an ordinary Rust project, which is organized as a Cargo workspace, builds on stable and doesn't depend on C libraries.
|
||||
So, just
|
||||
|
||||
```
|
||||
```bash
|
||||
$ cargo test
|
||||
```
|
||||
|
||||
@ -140,7 +140,7 @@ By default, log goes to stderr, but the stderr itself is processed by VS Code.
|
||||
`--log-file <PATH>` CLI argument allows logging to file.
|
||||
Setting the `RA_LOG_FILE=<PATH>` environment variable will also log to file, it will also override `--log-file`.
|
||||
|
||||
To see stderr in the running VS Code instance, go to the "Output" tab of the panel and select `rust-analyzer`.
|
||||
To see stderr in the running VS Code instance, go to the "Output" tab of the panel and select `Rust Analyzer Client`.
|
||||
This shows `eprintln!` as well.
|
||||
Note that `stdout` is used for the actual protocol, so `println!` will break things.
|
||||
|
||||
@ -148,7 +148,7 @@ To log all communication between the server and the client, there are two choice
|
||||
|
||||
* You can log on the server side, by running something like
|
||||
|
||||
```
|
||||
```bash
|
||||
env RA_LOG=lsp_server=debug code .
|
||||
```
|
||||
|
||||
@ -180,7 +180,7 @@ There are also several VS Code commands which might be of interest:
|
||||
|
||||
We have a built-in hierarchical profiler, you can enable it by using `RA_PROFILE` env-var:
|
||||
|
||||
```
|
||||
```bash
|
||||
RA_PROFILE=* // dump everything
|
||||
RA_PROFILE=foo|bar|baz // enabled only selected entries
|
||||
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
|
||||
For machine-readable JSON output, we have the `RA_PROFILE_JSON` env variable. We support
|
||||
filtering only by span name:
|
||||
|
||||
```
|
||||
```bash
|
||||
RA_PROFILE=* // dump everything
|
||||
RA_PROFILE_JSON="vfs_load|parallel_prime_caches|discover_command" // dump selected spans
|
||||
```
|
||||
@ -201,13 +201,13 @@ 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/
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
@ -220,7 +220,7 @@ Release process is handled by `release`, `dist`, `publish-release-notes` and `pr
|
||||
|
||||
`release` assumes that you have checkouts of `rust-analyzer`, `rust-analyzer.github.io`, and `rust-lang/rust` in the same directory:
|
||||
|
||||
```
|
||||
```bash
|
||||
./rust-analyzer
|
||||
./rust-analyzer.github.io
|
||||
./rust-rust-analyzer # Note the name!
|
||||
|
Loading…
x
Reference in New Issue
Block a user