diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-10 11:42:42 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-10 11:42:42 +0000 |
commit | 8e4be2708635818aa3e210f0e39fb871cc433004 (patch) | |
tree | 569110cbb504c0516b136c414610b0f2edbe5044 /crates/ra_lsp_server/tests/heavy_tests | |
parent | 01b15c9fc2ce128149872ffe02de022bdb157286 (diff) | |
parent | 2e9194a621ccb33872d6189ecc30a83c17e6e33a (diff) |
Merge #774
774: Batch crate & command r=matklad a=flodiebold
This adds a new crate, `ra_batch`, which is intended for scenarios where you're loading a workspace once and then running some analyses using the HIR API. Also, it adds a command to `ra_cli` which uses that to type-check all crates in a workspace and print some statistics:
E.g. in rust-analyzer:
```
> $ time target/release/ra_cli analysis-stats
Database loaded, 21 roots
Crates in this dir: 28
Total modules found: 231
Total declarations: 3694
Total functions: 2408
Total expressions: 47017
Expressions of unknown type: 19826 (42%)
Expressions of partially unknown type: 4482 (9%)
target/release/ra_cli analysis-stats 3,23s user 0,60s system 100% cpu 3,821 total
```
Or in rust-lang/rust:
```
> $ time ../opensource/rust-analyzer/target/release/ra_cli analysis-stats
Database loaded, 77 roots
Crates in this dir: 130
Total modules found: 1820
Total declarations: 35038
Total functions: 25914
Total expressions: 753678
Expressions of unknown type: 337975 (44%)
Expressions of partially unknown type: 92314 (12%)
../opensource/rust-analyzer/target/release/ra_cli analysis-stats 13,45s user 2,08s system 100% cpu 15,477 total
```
~This still needs a test. Type-checking all of rust-analyzer sadly takes almost a minute when compiled in debug mode :sweat_smile: So I'll need to add something simpler (maybe just looking at a few modules).~
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests')
0 files changed, 0 insertions, 0 deletions