Commit graph

3090 commits

Author SHA1 Message Date
bors[bot]
0e94d07b9c Merge #1638
1638: Avoid cloning a TtToken in SubtreeTokenSource::mk_token r=matklad a=lnicola

According to `perf record`, this function is the hottest one while running `ra_cli analysis-stats`:

Before:

```
6.05%  ra_cli  ra_cli        <ra_mbe::subtree_source::SubtreeTokenSource as ra_parser::TokenSource>::lookahead_nth
5.56%  ra_cli  ra_cli        <rowan::green::GreenNode as core:#️⃣:Hash>::hash
4.16%  ra_cli  libc-2.29.so  _int_malloc
3.93%  ra_cli  ra_cli        ra_mbe::subtree_source::SubtreeTokenSource::get

Database loaded, 255 roots, 231.676882ms
Crates in this dir: 27
Total modules found: 282
Total declarations: 9642
Total functions: 3287
Total expressions: 64616
Expressions of unknown type: 9111 (14%)
Expressions of partially unknown type: 3417 (5%)
Analysis: 24.012797561s, 0b allocated 0b resident
target/release/ra_cli analysis-stats  24.60s user 0.56s system 100% cpu 25.125 total
```

After:

```
5.85%  ra_cli  ra_cli        <rowan::green::GreenNode as core:#️⃣:Hash>::hash
4.55%  ra_cli  libc-2.29.so  _int_malloc
4.31%  ra_cli  ra_cli        ra_parser::parser::Parser::nth
3.61%  ra_cli  ra_cli        <ra_syntax::parsing::text_token_source::TextTokenSource as ra_parser::TokenSource>::lookahead_nth
3.54%  ra_cli  ra_cli        ra_syntax::syntax_node::SyntaxTreeBuilder::finish_node
3.46%  ra_cli  libc-2.29.so  _int_free
3.12%  ra_cli  libc-2.29.so  malloc
2.76%  ra_cli  ra_cli        ra_parser::event::process
2.68%  ra_cli  ra_cli        alloc::sync::Arc<T>::drop_slow
2.50%  ra_cli  ra_cli        ra_mbe::subtree_source::SubtreeTokenSource::get
2.31%  ra_cli  ra_cli        <smol_str::SmolStr as core:#️⃣:Hash>::hash
2.04%  ra_cli  libc-2.29.so  __memmove_avx_unaligned_erms
1.92%  ra_cli  ra_cli        <ra_mbe::subtree_source::SubtreeTokenSource as ra_parser::TokenSource>::lookahead_nth

Database loaded, 255 roots, 236.176803ms
Crates in this dir: 27
Total modules found: 282
Total declarations: 9642
Total functions: 3287
Total expressions: 64620
Expressions of unknown type: 9107 (14%)
Expressions of partially unknown type: 3425 (5%)
Analysis: 22.562328486s, 0b allocated 0b resident
target/release/ra_cli analysis-stats  23.12s user 0.57s system 100% cpu 23.659 total
```

r? @edwin0cheng, @matklad 

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-08-03 20:07:07 +00:00
Laurențiu Nicola
f52437371f Return a Ref from SubtreeTokenSource::get 2019-08-03 22:49:47 +03:00
bors[bot]
c5bdd02503 Merge #1630
1630: Removes `*/` from block doc comments r=matklad a=kjeremy

The trailing `/` was annoying me on hover.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-08-03 19:25:30 +00:00
Laurențiu Nicola
e58baaa5a1 Avoid cloning a TtToken in SubtreeTokenSource::mk_token 2019-08-03 21:21:09 +03:00
Alexander Andreev
83fe7b5fcb Resolve out of line modules inside inline module with attribute path
Fixed #1510
Fixed #1529
2019-08-03 19:44:59 +03:00
kjeremy
0f61aa1f09 Unconditionally trim the end of comments 2019-07-31 13:59:14 -04:00
kjeremy
8da8c147ee remove-comment 2019-07-31 11:53:47 -04:00
kjeremy
d65dc40348 Removes */ in block doc comments 2019-07-31 11:43:00 -04:00
kjeremy
4fccad9b2c Add explicit newline preserving tests 2019-07-31 10:46:15 -04:00
kjeremy
8d2068cf32 Update insta to 0.9.0 and cargo update 2019-07-31 10:05:00 -04:00
bors[bot]
1af7738c28 Merge #1627
1627: Hide ignored lines in rustdoc r=kjeremy a=rizakrko

This fixes #1620.

Co-authored-by: Roman Stoliar <rizakrko@rambler.ru>
2019-07-31 12:09:22 +00:00
Roman Stoliar
facc7a35a5 Fixed review comments 2019-07-30 21:25:51 +03:00
Evgenii P
06c3de310e rustfmt 2019-07-30 21:02:29 +07:00
Evgenii P
e7cdbe795a Fix flip comma assist 2019-07-30 20:33:58 +07:00
Roman Stoliar
1c11d7b1d8 Hide comments in rust section of doc comments 2019-07-30 03:46:38 +03:00
Phil Ellison
e6113c0998 Add merge_match_arm assist, bump rowan to 0.6.1 2019-07-29 21:59:52 +01:00
bors[bot]
a5fe9f7a87 Merge #1604
1604: Fix failing type interference for floating point literal r=matklad a=theotherphil

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/1592

Co-authored-by: Phil Ellison <phil.j.ellison@gmail.com>
2019-07-29 19:02:39 +00:00
Phil Ellison
d79dc38e99 Move assist test, add literal type inference test 2019-07-29 19:02:03 +01:00
bors[bot]
359b3376b3 Merge #1601
1601: Inline snapshots for tests r=matklad a=theotherphil

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/1127.

The "cargo format" commits are required to get the formatting tests to pass. However, they actually mess up the formatting.

Co-authored-by: Phil Ellison <phil.j.ellison@gmail.com>
2019-07-29 12:54:40 +00:00
bors[bot]
9e2925f340 Merge #1621
1621: Document AssistBuilder r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-07-29 12:44:14 +00:00
Aleksey Kladov
61739b0c17 Document AssistBuilder
closes #1603
2019-07-29 15:43:34 +03:00
bors[bot]
bf1369cdef Merge #1606
1606: Add `if let`, `while let` and match arm inlay hints r=matklad a=SomeoneToIgnore

<img width="693" alt="image" src="https://user-images.githubusercontent.com/2690773/62013363-152f1d80-b19a-11e9-90ea-07568757baa2.png">

Add more inline hints support.
Looks like `while let` type inference support is missing currently, so the corresponding hint tests lack the actual results.

I've also could not find a good way to distinguish between `a` and `b` pats in the following expressions:
`if let Some(Test { a: None, b: y }) = &test {};`

In this case we don't need to add a hint for first pat (`a: None`), since it's matched against the particular enum variant and need a hint for `y`, since it's a new variable.
But both `a` and `b` are `BIND_PAT` with similar contents, so looks like there's nothing I can check for to find any differences.

I don't display any hints for such cases now, to avoid confusion, but would be nice to know if there's a way to fix this behavior.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2019-07-29 12:30:39 +00:00
Alexander Andreev
3629268f71 Fixed request changes. 2019-07-29 15:16:58 +03:00
Alexander Andreev
538ec1122b Added resolve modules inside inline module
#1510
2019-07-29 09:54:40 +03:00
Kirill Bulatov
b8f95f42e1 Support destructuring patterns 2019-07-29 00:33:10 +03:00
Phil Ellison
fab8e9bb8a cargo format 2019-07-28 20:54:37 +01:00
Phil Ellison
4fd7ad908b Add special case for f32 and f43 suffices on Literal.kind 2019-07-28 20:47:44 +01:00
Phil Ellison
578bc05ca4 Add issue link and trailing newline 2019-07-28 20:25:06 +01:00
Phil Ellison
fe1b1dd7d9 More direct failing test 2019-07-28 19:52:30 +01:00
Phil Ellison
8e1a14a098 Add failing test 2019-07-28 18:41:29 +01:00
Phil Ellison
67e75ca126 Rerun cargo format, to make tests pass and formatting incorrect 2019-07-28 12:45:01 +01:00
Phil Ellison
44b2642900 Remove vertical ellipses in references.cs 2019-07-28 12:37:03 +01:00
Phil Ellison
1b74eed8ca Remove vertical ellipses from tests in complete_snippet.rs and presentation.rs 2019-07-28 12:33:21 +01:00
Phil Ellison
46c07ed578 Remove vertical ellipses from tests in complete_scope.rs 2019-07-28 12:28:14 +01:00
Phil Ellison
5c4df97996 cargo format 2019-07-28 12:08:06 +01:00
Phil Ellison
9f6909c0ce Inline snapshot for test_file_structure (less clear that this one is a good idea) 2019-07-28 12:01:28 +01:00
Phil Ellison
a72331f223 Inline snapshots for all tests in runnables.rs 2019-07-28 11:57:56 +01:00
Phil Ellison
8f71614bdd Inline snapshots for all tests in references.rs 2019-07-28 11:52:17 +01:00
Phil Ellison
69244a6e18 Inline snapshots for all tests in complete_snippet, remove now-unused check_completion 2019-07-28 11:45:03 +01:00
Phil Ellison
460423e66c Inline snapshots for all tests in presentation.rs 2019-07-28 11:35:48 +01:00
Phil Ellison
eb7d1b0fee Inline snapshots for all tests in complete_scope.rs 2019-07-28 11:24:29 +01:00
Phil Ellison
164ba6092c Remove unused highlights_code_inside_macro snapshot, inline rename_mod_in_dir snapshot 2019-07-28 10:42:31 +01:00
Aleksey Kladov
e29cbcbedd it's a good idea to build extension before installing it 2019-07-27 23:02:03 +03:00
Aleksey Kladov
ecb1327fed Overhaul installation process
The new commands are

$ cargo install-ra --client-code
$ cargo install-ra --server --jemalloc
2019-07-27 14:35:18 +03:00
Kirill Bulatov
5169a9d498 Improve inlay hinting for types
Add hints for types in for loop expressions.
Resolve types for every tuple parameter.
Refactor the code.
2019-07-26 18:06:31 +03:00
Kirill Bulatov
dbbb0beb3e Make Analysis api cancellable 2019-07-25 20:22:41 +03:00
Aleksey Kladov
459241f272 move syntax tests to unit tests 2019-07-24 12:49:19 +03:00
bors[bot]
bf3030404e Merge #1584
1584: switch to upstream unescape r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-07-24 09:03:26 +00:00
Aleksey Kladov
2473cb6a5c switch to upstream unescape 2019-07-24 11:47:28 +03:00
bors[bot]
a971c6d32d Merge #1583
1583: ⬆️ rowan r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-07-24 08:44:40 +00:00