Commit Graph

17927 Commits

Author SHA1 Message Date
bors[bot]
7b4f5c0262
Merge #9304
9304: internal: cleanup tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-16 20:28:23 +00:00
Aleksey Kladov
35772256f8 internal: cleanup tests 2021-06-16 23:27:46 +03:00
Aleksey Kladov
ee7b649d44 internal: switch some tests to minicore 2021-06-16 22:54:57 +03:00
bors[bot]
d6b8af4482
Merge #9301
9301: internal: Start refactoring ide_completion tests r=Veykril a=Veykril

Our current completion test infra resovles around usually just checking a specific `CompletionKind` which is suboptimal. We only see what we want to see in tests with this causing us to miss a lot of incorrect completions we are doing. Instead we should test for different cursor locations for all kinds(sans the magic kind maybe? not sure yet). This way we will also see potential duplicate completions that merely different in their kind.

Also since most completion submodules complete things in tests of other modules due to the tests overlapping it makes more sense to group these tests differently which implies moving them to a new module. Exceptions for this might be stuff like attribute completion as these cannot currently interfere.

I only wrote a few tests to check for completions in `ItemList` position so far and I already found a few incorrect/irrelevant completions as these haven't been tested properly due to them being hidden by the `CompletionKind` filtering.

I think `CompletionKind` doesn't really seem to be beneficial to me as to I can't think of a occasion where we would want to only check a specific completion kind.


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-16 19:53:43 +00:00
Lukas Wirth
aa644b5585 Move test_utils into tests module 2021-06-16 21:51:52 +02:00
Lukas Wirth
11115ebad8 Don't complete paths after attributes 2021-06-16 21:51:21 +02:00
Lukas Wirth
9ea6ee6b27 Don't show incorrect completions after unsafe or visiblity node 2021-06-16 21:51:20 +02:00
Lukas Wirth
1a8f76a224 Don't complete visibility accessors after existing ones 2021-06-16 21:51:20 +02:00
Lukas Wirth
d338a80394 Start refactoring ide_completion tests 2021-06-16 21:51:20 +02:00
Aleksey Kladov
604267088c internal: add iterator to minicore 2021-06-16 22:48:48 +03:00
Aleksey Kladov
7ba5482a04 internal: switch some tests to minicore 2021-06-16 22:26:46 +03:00
Aleksey Kladov
7e0d441687 internal: switch some tests to minicore 2021-06-16 22:24:11 +03:00
bors[bot]
f38770cd26
Merge #9302
9302: internal: Add builtin derives to attribute completion fixtures r=Veykril a=Veykril

bors R+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-16 17:28:13 +00:00
Lukas Wirth
a92ed1eef4 Don't complete already used derive attributes 2021-06-16 19:27:06 +02:00
Lukas Wirth
8f936c5571 Add builtin derives to attribute completion fixtures 2021-06-16 19:25:09 +02:00
bors[bot]
f6e73d510d
Merge #9258
9258: minor: Give `ImportPrefix` variants better config names r=matklad a=Veykril

I feel like `crate` and `self` work better than `by_crate` and `by_self`. The only reason for the current names were that `Self` doesn't work for the variant name on the rust side so I forgot about setting proper config names on serde layer.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-16 14:53:06 +00:00
bors[bot]
88c2e5995e
Merge #9300
9300: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-16 13:52:15 +00:00
Lukas Wirth
66b701ed3e Simplify 2021-06-16 15:51:01 +02:00
bors[bot]
1c034c084d
Merge #9299
9299: minor: Filter out non-type completions in the respective completions modules instead r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-16 13:10:44 +00:00
Lukas Wirth
354ad29493 Filter out non-type completions in the respective completions modules instead 2021-06-16 15:08:44 +02:00
bors[bot]
8022e6ad6f
Merge #9297
9297: internal: add fn to minicore r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-16 09:21:29 +00:00
Aleksey Kladov
8a4d9bb80a internal: add fn to minicore 2021-06-16 12:15:45 +03:00
Aleksey Kladov
d2c9f3add1 internal: add deref_mut to minicore 2021-06-16 10:30:29 +03:00
bors[bot]
2980fd430d
Merge #9267 #9279
9267: fix: Code: update the LSP server without asking r=matklad a=lnicola

Most LSP extensions seem to do the same thing, and this is causing some
confusion for users who don't notice the update prompt before Code hides
it.

9279: minor: Document installation via Homebrew r=matklad a=Svetlitski

`rust-analyzer` can be installed via [Homebrew](https://brew.sh) (AKA`brew`) on macOS. I've added instructions on how to do so to the documentation. Additionally, I added a `.gitignore` rule to ignore the HTML documentation produced by  `asciidoctor manual.adoc` so that it is not accidentally checked into `git`.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Kevin Svetlitski <kevin_svetlitski@berkeley.edu>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-15 20:45:54 +00:00
Aleksey Kladov
78668f76a0
Update docs/user/manual.adoc 2021-06-15 23:40:07 +03:00
bors[bot]
5ba5e6348f
Merge #9293
9293: fix: Show diagnostic fixes before assists r=matklad a=lnicola

Closes #9212

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-06-15 20:38:29 +00:00
bors[bot]
9bddd2af55
Merge #9294
9294: internal: introduce minicore -- a subset of libcore for testing r=matklad a=matklad

Clearly, we need one more fixed point iteration loop!

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-15 20:14:36 +00:00
Aleksey Kladov
7cbcbccc78 internal: switch some tests to minicore 2021-06-15 23:11:53 +03:00
Aleksey Kladov
0798cce9e5 internal: add result to minicore 2021-06-15 23:07:25 +03:00
bors[bot]
d0f2bc3b87
Merge #9292
9292: fix: Code: clean-up #8951 r=wxb1ank a=wxb1ank

#8951 was a major change in the VS Code extension and caused quite a few problems. This PR is a catch-all for bugs and improvements in the new code.

This should fix:
- #9284
- [this unreported bug](https://github.com/rust-analyzer/rust-analyzer/pull/8951/files#r651570446)
- ...and one or two uncaught exceptions I just found

The original lack of testing was my own fault, but this area of the VS Code API is also tricky for a couple reasons:
- The [FileSystem](https://github.com/rust-analyzer/rust-analyzer/pull/8951/files#r651570446) API does not list or warn about any exceptions, but [FileSystemProvider](https://github.com/rust-analyzer/rust-analyzer/pull/8951/files#r651570446) (which `FileSystem` is a wrapper of, AFAICT) does.
- At first glance, [Uri.path](https://github.com/rust-analyzer/rust-analyzer/pull/8951/files#r651570446) *looks* like it works for FS operations. It does not, at least, on Windows. You need to use `Uri.fsPath`.

I only use Windows, so I need people on macOS, Linux, and (possibly) NixOS to test this.

Co-authored-by: wxb1ank <wxblank@gmail.com>
2021-06-15 20:05:07 +00:00
Aleksey Kladov
ae92057df6 internal: switch some tests to minicore 2021-06-15 23:02:38 +03:00
Aleksey Kladov
2870d2bade internal: add option to minicore 2021-06-15 22:59:51 +03:00
bors[bot]
dcea1c536c
Merge #9295
9295: fix: Highlight unsafe trait refs as unsafe only in impl blocks and definitions r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-15 19:50:34 +00:00
Lukas Wirth
29054e02fb Highlight unsafe trait refs as unsafe only in impl blocks and definitions 2021-06-15 21:49:59 +02:00
Aleksey Kladov
3efe5c3426 internal: add future to minicore 2021-06-15 22:49:00 +03:00
Aleksey Kladov
2eef66a2ed internal: sanity-check minicore flags 2021-06-15 22:38:21 +03:00
Aleksey Kladov
09c4013ec0 internal: switch some tests to minicore 2021-06-15 22:02:29 +03:00
Aleksey Kladov
ee13e895e3 internal: switch some tests to minicore 2021-06-15 21:57:56 +03:00
Aleksey Kladov
0bb1f1bc90 internal: add ranges to minicore 2021-06-15 21:45:25 +03:00
Aleksey Kladov
f4b52682da internal: unindent some tests 2021-06-15 21:39:44 +03:00
Aleksey Kladov
b737b894cb internal: switch some tests to minicore 2021-06-15 21:36:50 +03:00
Aleksey Kladov
7ebac5e54c internal: switch some tests to minicore 2021-06-15 21:34:26 +03:00
Aleksey Kladov
0475201538 internal: switch some tests to minicore 2021-06-15 21:19:51 +03:00
Aleksey Kladov
f841369fee internal: switch some tests to minicore 2021-06-15 21:11:53 +03:00
wxb1ank
a6b0c056de Use .then() for Thenable 2021-06-15 14:03:34 -04:00
Aleksey Kladov
f521e41853 internal: introduce minicore -- a subset of libcore for testing 2021-06-15 21:03:08 +03:00
Laurențiu Nicola
e58f63dc63 Show diagnostic fixes before assists 2021-06-15 20:55:27 +03:00
wxb1ank
56e128a979 fix: clean-up #8951 2021-06-15 13:29:02 -04:00
Laurențiu Nicola
cbf53ba251 Consolidate the privacy notes 2021-06-15 20:07:59 +03:00
bors[bot]
7f482afada
Merge #9291
9291: minor: fix typo r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-15 14:20:35 +00:00