Commit graph

7188 commits

Author SHA1 Message Date
bors[bot]
5dcd9fdf5e
Merge #2895
2895: Rewrite ra_prof's profile printing r=michalt a=michalt

This changes the way we print things to first construct a mapping from
events to the children and uses that mapping to actually print things.
It should not change the actual output that we produce.

The new approach two benefits:

 * It avoids a potential quadratic behavior of the previous approach.
   For instance, for a vector of N elements:
   ```
   [Message{level: (N - 1)}, ..., Message{level: 1}, Message{level: 0}]
   ```
   we would first do a linear scan to find entry with level 0, then
   another scan to find one with level 1, etc.

 * It makes it much easier to improve the output in the future, because
   we now pre-compute the children for each entry and can easily take
   that into account when printing.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-29 20:09:49 +00:00
Michal Terepeta
644c383f65 A couple of small improvements to ra_prof printing
Based on suggestions from @matklad.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-29 20:55:35 +01:00
bors[bot]
d92a15c163
Merge #2943
2943: Re-sync queries for memory usage measurnment r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 15:11:38 +00:00
Aleksey Kladov
f1720d7983 Re-sync queries for memory usage measurnment 2020-01-29 16:10:46 +01:00
bors[bot]
b67f695956
Merge #2942
2942: Properly select a target for auto importing r=matklad a=SomeoneToIgnore

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

The corresponding test has the caret placed in the beggining of the document despite the import inserted, but I don't thing I should fix it here:
* in real life, there's some text written before the import and for those cases the caret behaves normally
* it's a separate functionality that needs to be refactored anyway later (the `auto_import_text_edit`)

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-29 14:35:28 +00:00
Kirill Bulatov
6d219c9a10 Properly select a target for auto importing 2020-01-29 16:23:18 +02:00
bors[bot]
e3c81b67ff
Merge #2941
2941: Freshen Architecture.md document r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 14:09:04 +00:00
Aleksey Kladov
84dfbfbd1d Freshen Architecture.md document 2020-01-29 15:08:31 +01:00
bors[bot]
2fb6af89eb
Merge #2940
2940: Freshen dev docs a tiny bits r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 13:46:00 +00:00
Aleksey Kladov
1065c2bf1d Freshen dev docs a tiny bits 2020-01-29 14:45:32 +01:00
bors[bot]
a0be39296d
Merge #2939
2939: Simplify fixture parsing r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 13:13:30 +00:00
Aleksey Kladov
d2fd252f9d Simplify fixture parsing 2020-01-29 14:06:23 +01:00
bors[bot]
f7268ddab2
Merge #2938
2938: Fix long loop timeout r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 13:04:46 +00:00
Aleksey Kladov
7cc0a86528 Fix long loop timeout 2020-01-29 14:04:10 +01:00
bors[bot]
abc5828c05
Merge #2937
2937: Parse cargo output a line at a time. r=kiljacken a=kiljacken

We previously used serde's stream deserializer to read json blobs from
the cargo output. It has an issue though: If the deserializer encounters
invalid input, it gets stuck reporting the same error again and again
because it is unable to foward over the input until it reaches a new
valid object.

Reading a line at a time and manually deserializing fixes this issue,
because cargo makes sure to only outpu one json blob per line, so should
we encounter invalid input, we can just skip a line and continue.

The main reason this would happen is stray printf-debugging in
procedural macros, so we still report that an error occured, but we
handle it gracefully now.

Fixes #2935

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-01-29 12:51:52 +00:00
Emil Lauridsen
4ec5f6e258 Change error output to make a bit more sense 2020-01-29 13:51:20 +01:00
Emil Lauridsen
8ffbe86dfd Parse cargo output a line at a time.
We previously used serde's stream deserializer to read json blobs from
the cargo output. It has an issue though: If the deserializer encounters
invalid input, it gets stuck reporting the same error again and again
because it is unable to foward over the input until it reaches a new
valid object.

Reading a line at a time and manually deserializing fixes this issue,
because cargo makes sure to only outpu one json blob per line, so should
we encounter invalid input, we can just skip a line and continue.

The main reason this would happen is stray printf-debugging in
procedural macros, so we still report that an error occured, but we
handle it gracefully now.

Fixes #2935
2020-01-29 13:40:27 +01:00
Aleksey Kladov
9f68f7acf2 Tweak readme 2020-01-29 13:25:32 +01:00
Aleksey Kladov
5643c0730a
Merge pull request #2936 from matklad/better-release
Make sure release uses the release branch, and not master
2020-01-29 12:24:09 +00:00
Aleksey Kladov
f4fd91a7fe Make sure release uses the release branch, and not master 2020-01-29 13:19:51 +01:00
bors[bot]
6fd29651b4
Merge #2931
2931: Added documentation to test_utils r=matklad a=Veetaha

Added some doc comments to test_utils functions while studying this crate. They should be all stable enough to document them.
Also some minor code relocation in `parse_fixture()` closer to its usage according to the advice of @matklad.

Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-01-29 11:06:18 +00:00
bors[bot]
7a2b87db73
Merge #2934
2934: Complain loudly if the main loop is blocked r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 10:24:08 +00:00
Aleksey Kladov
9753eb98cc Complain loudly if the main loop is blocked 2020-01-29 11:21:49 +01:00
Aleksey Kladov
aaa4861a0b More uniform naming 2020-01-29 11:15:08 +01:00
bors[bot]
3ea8940d94
Merge #2933
2933: Don't compute diagnostics on the main thread r=matklad a=matklad

closes #2909

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-29 10:14:12 +00:00
Aleksey Kladov
2d2585e03f Don't compute diagnostics on the main thread
closes #2909
2020-01-29 11:03:59 +01:00
Veetaha
5e1ae1d7aa test_utils: move flush!() to its usage as per conversation with @matklad 2020-01-29 03:53:15 +02:00
Veetaha
d3472e8ae4 test_utils: updated documentation and some typos 2020-01-29 03:52:13 +02:00
bors[bot]
3bdf2e0972
Merge #2917
2917: Prefer imports starting with std r=matklad a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/2915

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-28 16:22:18 +00:00
Kirill Bulatov
713870ee0c Add the tests 2020-01-28 18:03:24 +02:00
bors[bot]
50b6a989d2
Merge #2928
2928: Provide better diagnostics if the server is not in path r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-28 16:00:34 +00:00
Aleksey Kladov
94784cc546 Provide better diagnostics if the server is not in path 2020-01-28 17:00:00 +01:00
bors[bot]
3f70236965
Merge #2927
2927: Publicize debug printing of CrateDefMap r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-28 15:30:19 +00:00
Aleksey Kladov
4b9e5d5dd9 Publicize debug printing of CrateDefMap 2020-01-28 16:29:31 +01:00
Kirill Bulatov
07b505b633 Revert accidental package-lock.json change 2020-01-28 17:21:40 +02:00
Kirill Bulatov
762d293581 Apply the proposed refactoring 2020-01-28 17:19:41 +02:00
bors[bot]
2ddfc4ed5b
Merge #2926
2926: Standard formatting for array types r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-28 14:33:11 +00:00
Aleksey Kladov
6ca19b2188 Standard formatting for array types 2020-01-28 15:32:20 +01:00
bors[bot]
82ffe597ca
Merge #2925
2925: ⬆️ node r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-28 14:12:15 +00:00
Aleksey Kladov
c378133185 ⬆️ node 2020-01-28 15:11:44 +01:00
bors[bot]
76e17fe7d8
Merge #2924
2924: Modify ordering of drops in check watcher to only ever have one cargo r=matklad a=kiljacken

Due to the way drops are ordered when assigning to a mutable variable we
were launching a new cargo sub-process before letting the old one quite.

By explicitly replacing the original watcher with a dummy first, we
ensure it is dropped and the process is completed, before we start the
new process.

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-01-28 13:54:29 +00:00
Emil Lauridsen
35025f0975 Modify ordering of drops in check watcher to only ever have one cargo
Due to the way drops are ordered when assigning to a mutable variable we
were launching a new cargo sub-process before letting the old one quite.

By explicitly replacing the original watcher with a dummy first, we
ensure it is dropped and the process is completed, before we start the
new process.
2020-01-28 14:48:50 +01:00
bors[bot]
e8f990a3d1
Merge #2923
2923: Don't do check progress update for fresh crates r=matklad a=kiljacken

Skip sending progress updates for crates that aren't getting checked.

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-01-28 13:40:14 +00:00
Emil Lauridsen
fdc04ef920 Don't do check progress update for fresh crates 2020-01-28 14:33:52 +01:00
bors[bot]
912776fd95
Merge #2916
2916: Buffer reads from cargo check's stdout r=matklad a=lnicola

`Stdio::piped()` is unbuffered, which caused RA to read the output of `cargo check` one byte at a time (out of 114KB in my test).

This isn't obviously faster on my system, but making fewer syscalls sounds like a good idea.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-01-27 23:33:06 +00:00
Laurențiu Nicola
c34571c19e Buffer reads from cargo check's stdout 2020-01-28 01:27:43 +02:00
Kirill Bulatov
7a2e449424 Prefer imports starting with std 2020-01-28 01:02:06 +02:00
bors[bot]
5dd8f8e26f
Merge #2810
2810: Improves reference search by StructLiteral r=mikhail-m1 a=mikhail-m1

Hey, I've made some changes to improve search for struct literals, now it works for `struct Foo<|> {`, `struct Foo <|>{`, `struct Foo<|>(`. Unfortunately tuple creation is represented as a call expression, so for tuples it works only is search is started in a tuple declaration.  It leads to incorrect classification of function calls during search phase, but from user perspective it's not visible and works as expected. May be it worth to add a comment or rename it to remove this misleading classification. Issue #2549.

Co-authored-by: Mikhail Modin <mikhailm1@gmail.com>
2020-01-27 21:58:35 +00:00
Mikhail Modin
fbc3ffcee6 Improves reference search by StructLiteral 2020-01-27 21:34:19 +00:00
bors[bot]
5cfaf87627
Merge #2872
2872: Upgrade Chalk r=matklad a=flodiebold

This is just keeping track of the changes required to upgrade Chalk; currently we can't really merge it since it breaks opaque types.

Now also makes use of the newly introduced `solve_limited` to implement fuel.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-27 21:24:24 +00:00