Commit Graph

17561 Commits

Author SHA1 Message Date
Lukas Wirth
0724bd0f21 Add attribute completion tests 2021-05-28 01:02:41 +02:00
bors[bot]
5b4589f474
Merge #9029
9029: minor: test that `ItemTree` makes `hir_def` queries syntax-independent r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-27 22:47:04 +00:00
Jonas Schievink
55f3ca2b74 Test that ItemTree works as intended 2021-05-28 00:46:05 +02:00
Lukas Wirth
594270be49 tt muncher time 2021-05-28 00:35:21 +02:00
Lukas Wirth
ab9c6ea4dd Split attribute completion module into attribute, derive and lint modules 2021-05-27 23:40:33 +02:00
Andy Russell
a0cd7fe242
only advertise range formatting support if enabled 2021-05-27 17:36:13 -04:00
Lukas Wirth
fc37e2f953 Attribute completion is context aware 2021-05-27 23:28:14 +02:00
bors[bot]
01bfc5f5c0
Merge #9026
9026: Complete modules in assoc item lists r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-27 19:13:34 +00:00
Lukas Wirth
ea251cbd4a Complete modules in item lists 2021-05-27 21:12:50 +02:00
Lukas Wirth
7ad378fec0 Complete modules in assoc item lists 2021-05-27 20:53:38 +02:00
Jonas Schievink
26b4777e1f Move hir_ty incremental test to its own file 2021-05-27 20:21:52 +02:00
bors[bot]
a2940c42c0
Merge #9020
9020: fix: Don't complete non-macro item paths in impls and modules r=Veykril a=Veykril

Part of #8518
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-27 16:34:46 +00:00
Laurențiu Nicola
aabbc84957 Display unknown types in analysis-stats 2021-05-27 19:30:28 +03:00
Lukas Wirth
3a16950fd9 Cleanup ImmediateLocation determination 2021-05-27 18:16:39 +02:00
bors[bot]
cc5d806921
Merge #9024
9024: internal: Don't store supertraits in ItemTree r=jonas-schievink a=lnicola

Closes #9010

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-27 14:27:56 +00:00
Laurențiu Nicola
2268a220e4 Don't store supertraits in ItemTree 2021-05-27 16:52:30 +03:00
Jonas Schievink
33debc4065 Update salsa 2021-05-27 15:05:41 +02:00
bors[bot]
d0a4ba294c
Merge #8997
8997: internal: stop expanding UseTrees during ItemTree lowering r=jonas-schievink a=jonas-schievink

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

Messy diff, but `ItemTree` lowering got simpler, since we now have a strict 1-to-1 mapping between `ast::Item` and `ModItem`.

The most messy part is mapping a single `UseTree` back to its `ast::UseTree` counterpart for diagnostics, but I think the ad-hoc source map built during lowering does the job.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-27 11:56:26 +00:00
Jonas Schievink
196cb65ead Drop ignore from doctests 2021-05-27 13:55:31 +02:00
Lukas Wirth
f41c983424 Don't complete non-macro item paths in impls and modules 2021-05-27 12:23:36 +02:00
bors[bot]
bfb06e17ac
Merge #9022
9022: internal: disable debuginfo afterall r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-27 08:59:53 +00:00
Aleksey Kladov
7d8f701e99 internal: disable debuginfo afterall 2021-05-27 11:53:33 +03:00
bors[bot]
a9a978e0bb
Merge #9021
9021: internal: explain the motivation behind early configuration r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-27 08:17:10 +00:00
Aleksey Kladov
cabb679cbb internal: explain the motivation behind early configuration 2021-05-27 11:16:14 +03:00
bors[bot]
7d1653dcdc
Merge #9005
9005: internal: Document semantic token tags r=matklad a=Veykril

Closes #6457

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-27 07:04:15 +00:00
bors[bot]
61ebc3572d
Merge #9019
9019: internal: simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-27 01:48:36 +00:00
Lukas Wirth
30948e1ecb simplify 2021-05-27 03:47:20 +02:00
bors[bot]
12d46f835e
Merge #9018
9018: Collapse more CompletionContext booleans into enums r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-27 01:22:28 +00:00
Lukas Wirth
6ec4ea8d9e simplify 2021-05-27 03:15:48 +02:00
Lukas Wirth
7de925b8ab Collapse more CompletionContext booleans into enums 2021-05-27 02:54:49 +02:00
bors[bot]
d6ed315806
Merge #9017
9017: internal: Reduce the number of traits passed through chalk during applicable trait lookup r=SomeoneToIgnore a=SomeoneToIgnore

Inherent traits can be omitted before trait solving, presumably slightly helping https://github.com/rust-analyzer/rust-analyzer/issues/7542 and slightly simplifying the code.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2021-05-26 23:06:59 +00:00
Kirill Bulatov
050c592b8c Exclude inherent traits more eagerly 2021-05-27 02:00:23 +03:00
bors[bot]
7624729d61
Merge #9016
9016: Set `record_pat_syntax` more precisely in CompletionContext r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-26 21:49:06 +00:00
Lukas Wirth
1f897f7319 Set record_pat_syntax more precisely in CompletionContext 2021-05-26 23:46:00 +02:00
bors[bot]
b4015b6aaa
Merge #8995
8995: fix: Create tasks for all workspaces r=matklad a=SomeoneToIgnore

Follow-up of https://github.com/rust-analyzer/rust-analyzer/pull/8955#discussion_r637897170

Before: 
<img width="593" alt="image" src="https://user-images.githubusercontent.com/2690773/119575267-712b5300-bdbf-11eb-833c-f688f7a7dd0f.png">

After: 
<img width="643" alt="image" src="https://user-images.githubusercontent.com/2690773/119575273-74264380-bdbf-11eb-8283-a78bbcb7346e.png">

This is the first time I've used multiple workspaces feature in VSCode, but so far looks like
* opening detached files works
* run and debug lens work
* Rust Analyzer: Run action works
* run task works and now shows tasks for all workspaces
* there are no platform-specific changes involved

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2021-05-26 20:58:07 +00:00
bors[bot]
666fc1cec1
Merge #9015
9015: Merge pattern completion related bools into an enum r=Veykril a=Veykril

The two bools can never both be set so this is basically just a tri-state enum.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-26 20:43:53 +00:00
Lukas Wirth
7d865ef071 Merge pattern completion related bools into an enum 2021-05-26 22:39:47 +02:00
bors[bot]
8389510f8d
Merge #9012
9012: feat: add tab stops for keyword completions r=matklad a=eduardocanellas

Add tab stops for all the keywords that I judged fit. I also introduced some line breaks and spaces, following the pattern I saw in the `postfix` module.

Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
2021-05-26 20:29:52 +00:00
bors[bot]
1caf79c389
Merge #9014
9014: simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-26 19:11:47 +00:00
Lukas Wirth
26e784a575 simplify 2021-05-26 21:09:27 +02:00
Eduardo Canellas
052df3deb7 feat: add tab stops for keyword completions 2021-05-26 14:24:54 -03:00
bors[bot]
bb1c7fc0cf
Merge #9008
9008: fix: remove undesired completions from trait/impl blocks r=Veykril a=eduardocanellas

Related to #8518


Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
2021-05-26 17:04:09 +00:00
Eduardo Canellas
ce36746035 fix: remove undesired completions from trait/impl blocks 2021-05-26 13:21:27 -03:00
bors[bot]
f3aaae6555
Merge #9007
9007: Internal: `clippy::redundant_clone` fixes r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-26 15:36:14 +00:00
Laurențiu Nicola
8206939fed clippy::redundant_clone fixes 2021-05-26 18:34:50 +03:00
Lukas Wirth
7ebfc3d410 Document semantic token tags 2021-05-26 15:23:05 +02:00
bors[bot]
5a1fd05760
Merge #9003
9003: minor: Document semantic token modifiers r=Veykril a=Veykril

Part of #6457

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-26 12:08:56 +00:00
Lukas Wirth
887dd2d5bb Document semantic token modifiers 2021-05-26 13:37:54 +02:00
bors[bot]
5701c553cb
Merge #9002
9002: Move annotations below item attributes r=Veykril a=Veykril

This moves annotations/code lenses below attributes in items, bringing them inline with functions where this is already the case. This is done by changing the annotations covering range to just the name node's range which is also more inline with what the lsp expects which is that the range should ideally only cover a single line. 

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9000
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-26 10:26:19 +00:00
Lukas Wirth
dfa47eaadb Move annotations below item attributes 2021-05-26 12:23:51 +02:00