Commit Graph

7953 Commits

Author SHA1 Message Date
Aleksey Kladov
b0f03db51d Remove deprecated function 2020-08-13 11:37:54 +02:00
Aleksey Kladov
26b98b07aa Cleanup **Move Guard** assist 2020-08-13 10:57:17 +02:00
Aleksey Kladov
7d9480c6eb fmt 2020-08-13 10:36:04 +02:00
Aleksey Kladov
68c2238725 Rename ra_cfg -> cfg 2020-08-13 10:36:04 +02:00
Aleksey Kladov
5734cc8586 Simplify 2020-08-13 10:36:04 +02:00
Aleksey Kladov
3615758f8e Minimize deps 2020-08-13 10:36:04 +02:00
Aleksey Kladov
2f45cfc415 Rename ra_mbe -> mbe 2020-08-13 10:36:04 +02:00
Aleksey Kladov
0e6b94de78 Minor 2020-08-13 10:36:04 +02:00
Pavan Kumar Sunkara
349e6c62ad Rename ra_proc_macro_srv -> proc_macro_srv 2020-08-13 03:18:19 +02:00
Aleksey Kladov
0635458a6b **Merge Imports** assist handles self 2020-08-12 18:59:13 +02:00
Aleksey Kladov
a1c187eef3 Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
Aleksey Kladov
50a02eb359 Rename ra_parser -> parser 2020-08-12 17:14:23 +02:00
Aleksey Kladov
6dafc13f5f Rename ra_text_edit -> text_edit 2020-08-12 17:03:06 +02:00
Aleksey Kladov
7510048ec0 Cleanup TextEdit API 2020-08-12 16:58:56 +02:00
Aleksey Kladov
8d34262956 Rename ra_toolchain -> toolchain 2020-08-12 16:52:28 +02:00
Aleksey Kladov
550d7fbe3c Rename ra_tt -> tt 2020-08-12 16:46:54 +02:00
Aleksey Kladov
208b7bd7ba Rename ra_prof -> profile 2020-08-12 16:35:29 +02:00
Aleksey Kladov
98baa9b569 Rename ra_arena 2020-08-12 16:22:05 +02:00
bors[bot]
1e8b2c498a
Merge #5637
5637: SSR: Matching trait associated constants, types and functions r=matklad a=davidlattimore

This fixes matching of things like `HashMap::default()` by resolving `HashMap` instead of `default` (which resolves to `Default::default`).

Same for associated constants and types that are part of a trait implementation.

However, we still don't support matching calls to trait methods.

Co-authored-by: David Lattimore <dml@google.com>
2020-08-12 13:50:34 +00:00
bors[bot]
5b8fdfe231
Merge #5553
5553: Add fix ranges for diagnostics r=matklad a=SomeoneToIgnore

A follow-up of https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Less.20red.20in.20the.20code

Now diagnostics can apply fixes in a range that's different from the range used to highlight the diagnostics.
Previous logic did not consider the fix range, having both ranges equal, which could cause a lot of red noise in the editor.
Now, the fix range gets used with the fix, the diagnostics range is used for everything else which allows to improve the error highlighting.

before:
<img width="191" alt="image" src="https://user-images.githubusercontent.com/2690773/88590727-df9a6a00-d063-11ea-97ed-9809c1c5e6e6.png">
after:
<img width="222" alt="image" src="https://user-images.githubusercontent.com/2690773/88590734-e1fcc400-d063-11ea-9b7c-25701cbd5352.png">

`MissingFields` and `MissingPatFields` diagnostics now have the fix range as `ast::RecordFieldList` of the expression with an error (as it was before this PR), and the diagnostics range as a `ast::Path` of the expression, if it's present (do you have any example of `ast::Expr::RecordLit` that has no path btw?).
The rest of the diagnostics have both ranges equal, same as it was before this PR.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-08-12 13:44:13 +00:00
bors[bot]
11de7ac2fb
Merge #4743
4743: Add tracking of packed repr, use it to highlight unsafe refs r=matklad a=Nashenas88

Taking a reference to a misaligned field on a packed struct is an
unsafe operation. Highlight that behavior. Currently, the misaligned
part isn't tracked, so this highlight is a bit too aggressive.

Fixes #4600

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
Co-authored-by: Paul Daniel Faria <nashenas88@users.noreply.github.com>
Co-authored-by: Paul Daniel Faria <paulf@pop-os.localdomain>
2020-08-12 13:20:18 +00:00
bors[bot]
2d41cc0ea3
Merge #5722
5722: Replace SepBy with Itertools

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 13:06:38 +00:00
Aleksey Kladov
1c359ab634 Replace SepBy with Itertools 2020-08-12 15:04:06 +02:00
bors[bot]
441fbe3b0a
Merge #5721
5721: Cleanup parser modifiers tests

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 12:53:11 +00:00
Aleksey Kladov
f8bfd77e84 Cleanup parser modifiers tests 2020-08-12 14:52:37 +02:00
Aleksey Kladov
f73a6419d4 Allow default everywhere
closes #5681
2020-08-12 14:28:32 +02:00
bors[bot]
42a1692629
Merge #5720
5720: Fix docs

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 11:59:02 +00:00
Aleksey Kladov
c9a42c7c46 Fix docs 2020-08-12 13:56:58 +02:00
bors[bot]
4b3d99f98f
Merge #5699
5699: Fix clippy warnings r=matklad a=popzxc

Currently clippy spawns a bunch of warnings on the `rust-analyzer` project. Nothing critical, but easy to fix, so I guess it won't harm.

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
2020-08-12 11:51:53 +00:00
Igor Aleksanov
fcd4b0176f Revert style preference-related fixes 2020-08-12 14:08:55 +03:00
bors[bot]
e471cb2a12
Merge #5718
5718: Deny clippy

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 10:51:02 +00:00
Aleksey Kladov
49af51129b Deny clippy 2020-08-12 12:49:48 +02:00
bors[bot]
d0fd8eb7f6
Merge #5717
5717: Minor

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 10:35:18 +00:00
Jonas Schievink
b27d5233bb
Merge pull request #5716 from jonas-schievink/musl
Fix build on musl and test it in CI
2020-08-12 12:31:17 +02:00
Jonas Schievink
67b2b3d0ce Fix build on musl and test it in CI 2020-08-12 12:23:25 +02:00
Aleksey Kladov
96001921fc Minor 2020-08-12 12:21:03 +02:00
bors[bot]
87429768bd
Merge #5711
5711: Display snippet in the completion label r=matklad a=SomeoneToIgnore

Before, the completion did not show the actual snippet and it was hard to understand what to input to get the right snippet:

<img width="467" alt="image" src="https://user-images.githubusercontent.com/2690773/89941040-21f6a600-dc23-11ea-94b8-61f77f88feaf.png">
<img width="367" alt="image" src="https://user-images.githubusercontent.com/2690773/89941046-23c06980-dc23-11ea-8034-6c4e14357c94.png">

Now it's more clear:

<img width="315" alt="image" src="https://user-images.githubusercontent.com/2690773/89941124-42befb80-dc23-11ea-9fcc-5fd49cc92b74.png">
<img width="210" alt="image" src="https://user-images.githubusercontent.com/2690773/89941132-4488bf00-dc23-11ea-99c2-12ec66e0a044.png">


Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-08-12 10:00:08 +00:00
Aleksey Kladov
8aba6bfef5 Simplify 2020-08-12 10:14:08 +02:00
Kirill Bulatov
7543b06d30 Display snippet in the completion label 2020-08-11 22:33:17 +03:00
Kirill Bulatov
db12ccee96 Better naming and docs 2020-08-11 17:52:05 +03:00
Kirill Bulatov
188ec3459e Simplify fix structure 2020-08-11 17:13:40 +03:00
Kirill Bulatov
37aa68f050 Add rustdocs 2020-08-11 15:09:08 +03:00
Kirill Bulatov
c8cad76d25 Improve the ide diagnostics trait API 2020-08-11 15:09:08 +03:00
Kirill Bulatov
29fbc8e021 Move the DiagnosticsWithFix trait on the ide level 2020-08-11 15:09:08 +03:00
Kirill Bulatov
9368619939 Make the fix AST source Optional 2020-08-11 15:09:08 +03:00
Kirill Bulatov
9963f43d51 Refactor the diagnostics 2020-08-11 15:09:08 +03:00
Kirill Bulatov
cfbbd91a88 Require source implementations for Diagnostic 2020-08-11 15:09:08 +03:00
Kirill Bulatov
21184a1b2a Restore accidentally removed public method 2020-08-11 15:09:08 +03:00
Kirill Bulatov
cb0b13a583 Fix another missing fields diagnostics 2020-08-11 15:09:08 +03:00
Kirill Bulatov
ee1586c1ed Better naming 2020-08-11 15:09:08 +03:00