Commit Graph

8037 Commits

Author SHA1 Message Date
bors[bot]
1916a78c6a
Merge #2914
2914: vscode-languageclient 6.1.0 r=matklad a=kjeremy

Adds client side support for proposed semantic highlighting extension

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-01-27 16:24:36 +00:00
kjeremy
1266810e55 vscode-languageclient 6.1.0
Adds support for proposed semantic highlighting extension
2020-01-27 10:25:22 -05:00
bors[bot]
e48adcb035
Merge #2913
2913: Update insta r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-01-27 14:55:09 +00:00
kjeremy
bcef1ddf63 Update insta 2020-01-27 09:52:34 -05:00
bors[bot]
87e1baf242
Merge #2910
2910: Use package script r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-27 13:50:04 +00:00
Jeremy Kolb
1b5b30f2ac
Update docs/user/README.md
Co-Authored-By: Veetaha <veetaha2@gmail.com>
2020-01-27 08:49:34 -05:00
bors[bot]
1d729033eb
Merge #2883
2883: Implement Syntax Highlight inside macro call r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-27 13:36:26 +00:00
bors[bot]
4f9506416c
Merge #2887
2887: Initial auto import action implementation r=matklad a=SomeoneToIgnore

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

Adds an auto import action implementation.

This implementation is not ideal and has a few limitations:

* The import search functionality should be moved into a separate crate accessible from ra_assists.
This requires a lot of changes and a preliminary design. 
Currently the functionality is provided as a trait impl, more on that here: https://github.com/rust-analyzer/rust-analyzer/issues/2180#issuecomment-575690942

* Due to the design desicion from the previous item, no doctests are run for the new aciton (look for a new FIXME in the PR)

* For the same reason, I have to create the mock trait implementaion to test the assist

* Ideally, I think we should have this feature as a diagnostics (that detects an absense of an import) that has a corresponding quickfix action that gets evaluated on demand.
Curretly we perform the import search every time we resolve the import which looks suboptimal.
This requires `classify_name_ref` to be moved from ra_ide, so not done currently.

A few improvements to the imports mechanism to be considered later:

* Constants like `ra_syntax::SyntaxKind::NAME` are not imported, because they are not present in the database

* Method usages are not imported, they are found in the database, but `find_use_path` does not return any import paths for them

* Some import paths returned by the `find_use_path` method end up in `core::` or `alloc::` instead of `std:`, for example: `core::fmt::Debug` instead of `std::fmt::Debug`.
This is not an error techically, but still looks weird.

* No detection of cases where a trait should be imported in order to be able to call a method

* Improve `auto_import_text_edit` functionality: refactor it and move away from the place it is now, add better logic for merging the new import with already existing imports

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-27 13:04:53 +00:00
Kirill Bulatov
9be1ab7ff9 Code review fixes 2020-01-27 14:42:45 +02:00
bors[bot]
a108f22d83
Merge #2908
2908: Update crates r=matklad a=kjeremy

Updates insta to 0.13 and bumps everything else.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-27 11:21:54 +00:00
Kirill Bulatov
9a6b5c6183 Enforce alphabetical import sorting 2020-01-27 01:53:59 +02:00
Kirill Bulatov
1a78991df6 Adjust the tests 2020-01-27 00:57:24 +02:00
Kirill Bulatov
d0a782ef1c Have a better trait interface 2020-01-27 00:17:10 +02:00
Kirill Bulatov
bef5cf0b99 Raise the import search query cap 2020-01-27 00:16:29 +02:00
Kirill Bulatov
f57239729c Remove unnecessary lifetime parameter 2020-01-27 00:16:29 +02:00
Kirill Bulatov
316795e074 Initial auto import action implementation 2020-01-27 00:16:29 +02:00
Jeremy Kolb
6967472703 Move snaps to new naming scheme 2020-01-26 13:29:01 -05:00
Jeremy Kolb
141dc7b81a
Use package script 2020-01-26 12:57:54 -05:00
Jeremy Kolb
b89991daed Update crates 2020-01-26 10:46:45 -05:00
bors[bot]
d1330a4a65
Merge #2906
2906: Fix thread priority problems on windows r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-26 13:17:19 +00:00
Aleksey Kladov
9faebd9d64 Gate CI on windows build 2020-01-26 14:15:57 +01:00
Aleksey Kladov
493a903f22 Bump main thread priority on windows 2020-01-26 14:15:57 +01:00
bors[bot]
13743d1073
Merge #2907
2907: fixed inline_local_variable bug #2900 r=matklad a=TomasKralCZ

This also affects issues like #2666.

Co-authored-by: Tomáš <tomas@kral.hk>
2020-01-26 11:23:22 +00:00
Tomáš
ec6a7f0710 fixed inline_local_variable bug 2020-01-25 21:07:21 +01:00
Aleksey Kladov
40109941db Use default threadpool size 2020-01-25 13:27:36 +01:00
bors[bot]
adda6dbdf8
Merge #2899
2899: Provide more runners for potential tests r=matklad a=SomeoneToIgnore

Based on the https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Runners.20for.20custom.20test.20annotations discussion.

Adds a test runner for every method that has an annotation that contains `test` word in it, allowing to run tests annotated with custom testing annotations such as `#[tokio::test]`, `#[test_case(...)]` and others at costs of potentially emitting some false-positives.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-25 11:10:28 +00:00
bors[bot]
fb81726ee5
Merge #2903
2903: Add print_time helper r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-25 10:59:46 +00:00
Aleksey Kladov
6577a7622d Add print_time helper 2020-01-25 11:59:11 +01:00
Aleksey Kladov
f44aee27d3 Disable env_logger humantime feature
We rarely care about timings of events, and, when we care, we need
millisecond precision
2020-01-25 11:53:40 +01:00
bors[bot]
c6dbf406a9
Merge #2901
2901: Cancel requests during shutdown r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-24 15:37:11 +00:00
Aleksey Kladov
b90ea640e6 Cancel requests during shutdown 2020-01-24 16:35:37 +01:00
Kirill Bulatov
3137215e8d Provide more runners for potential tests 2020-01-23 13:40:21 +02:00
bors[bot]
8a4c248c48
Merge #2898
2898: Remove RWLock from check watcher. r=matklad a=kiljacken

@matklad mentioned this might be a good idea.

So the general idea is that we don't really need the lock, as we can
just clone the check watcher state when creating a snapshot. We can then
use `Arc::get_mut` to get mutable access to the state from `WorldState`
when needed.

Running with this it seems to improve responsiveness a bit while cargo
is running, but I have no hard numbers to prove it. In any case, a
serialization point less is always better when we're trying to be
responsive.

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-01-23 11:35:31 +00:00
Emil Lauridsen
05aa5b854b Remove RWLock from check watcher.
@matklad mentioned this might be a good idea.

So the general idea is that we don't really need the lock, as we can
just clone the check watcher state when creating a snapshot. We can then
use `Arc::get_mut` to get mutable access to the state from `WorldState`
when needed.

Running with this it seems to improve responsiveness a bit while cargo
is running, but I have no hard numbers to prove it. In any case, a
serialization point less is always better when we're trying to be
responsive.
2020-01-23 09:26:08 +01:00
Kevin DeLorey
bc1fc6239d Renamed the trait completion mod. 2020-01-22 22:38:03 -06:00
Kevin DeLorey
e3cda83f90 Added basic support for completing fn for trait impl. 2020-01-22 22:34:00 -06:00
bors[bot]
2fb8a46122
Merge #2896
2896: Update crates r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-01-22 20:49:35 +00:00
kjeremy
ee7dd4b9ae Update crates 2020-01-22 15:40:35 -05:00
Michal Terepeta
39cbb6b620 Rewrite ra_prof's profile printing
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>
2020-01-22 20:13:56 +01:00
bors[bot]
9b1465af32
Merge #2894
2894: Omit default parameters for references r=matklad a=SomeoneToIgnore



Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-22 15:00:21 +00:00
Kirill Bulatov
4029e44102 Omit default parameters for reference types 2020-01-22 16:55:09 +02:00
bors[bot]
a5407ddc05
Merge #2891
2891: ra_syntax: removed code duplication and token reevaluation r=Veetaha a=Veetaha

Just a small refactoring along the way of reading the codebase

Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-01-22 11:23:21 +00:00
Veetaha
fa31841f1f Fixed a typo 2020-01-22 13:02:21 +02:00
Veetaha
1ac105056a Fixed a typo 2020-01-22 13:02:21 +02:00
Veetaha
b6be1b6f61 Preserved a comment on the bug previously present in ast::Literal::kind() 2020-01-22 13:02:21 +02:00
Veetaha
3ec781d4f2 ra_syntax: remove code duplication and token reevaluation from ast::Literal::kind() 2020-01-22 13:02:21 +02:00
Aleksey Kladov
b982d60a4d Don't fail fast on CI 2020-01-22 11:53:47 +01:00
bors[bot]
e95794da43
Merge #2893
2893: Add syntax guide r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-22 10:13:41 +00:00
Aleksey Kladov
fd69f62976 Add syntax guide 2020-01-22 11:13:11 +01:00
bors[bot]
ad10d0c8b9
Merge #2884
2884: vscode-languageclient 6.0.1 r=matklad a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-21 08:24:37 +00:00