Commit Graph

7161 Commits

Author SHA1 Message Date
Aleksey Kladov
aaa4861a0b More uniform naming 2020-01-29 11:15:08 +01:00
Aleksey Kladov
2d2585e03f Don't compute diagnostics on the main thread
closes #2909
2020-01-29 11:03:59 +01: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
Florian Diebold
339a11c33c Tweak Chalk settings 2020-01-27 21:52:35 +01:00
Florian Diebold
d3a3e5abdf Ignore failing impl Trait tests 2020-01-27 21:38:10 +01:00
Florian Diebold
96ddf2962c Upgrade Chalk 2020-01-27 21:25:33 +01:00
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