Commit Graph

19389 Commits

Author SHA1 Message Date
bors[bot]
8f683e911c
Merge #10049
10049: minor: nicer way to defeat disjoint closure captures r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-26 19:14:09 +00:00
Aleksey Kladov
cb3d04c818 minor: nicer way to defeat disjoint closure captures
Thanks https://internals.rust-lang.org/t/feature-idea-edition-dependent-names-replacing-standard-library-items/15198/27?u=matklad!
2021-08-26 22:13:50 +03:00
unexge
c0d2b44250 fix: correctly complete macro call if cursor at ! 2021-08-26 19:44:46 +03:00
Vincent Esche
74880a10ae Extend CargoConfig.unset_test_crates to allow for efficiently disabling #[cfg(test)] on all crates without having to first load the crate graph 2021-08-26 13:10:14 +02:00
bors[bot]
55d4813561
Merge #10032
10032: Fix missing unsafe block for the nightly change r=lnicola a=oxalica

Fix #10022

Tested via vscode extension.

Co-authored-by: oxalica <oxalicc@pm.me>
2021-08-26 09:33:12 +00:00
oxalica
15eccf29e8
Fix missing unsafe block for the nightly change
Fix #10022
2021-08-26 17:21:23 +08:00
bors[bot]
793389b61a
Merge #10030
10030: fix: Fix multiple derives in one attribute not expanding all in expand_macro r=Veykril a=Veykril

It's probably better to only expand the exact derive the cursor is on(if possible) instead of all derives in the attribute the cursor is one.
follow up to #10029
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-26 01:34:30 +00:00
Lukas Wirth
0f3617f76f fix: Fix multiple derives in one attribute not expanding all in expand_macro 2021-08-26 03:32:45 +02:00
bors[bot]
49763c3cdb
Merge #10029
10029: internal: Improve expand_macro r=Veykril a=Veykril

- Adds a few more newlines to the output making it more readable
- Fixes a bug with multiple derives not being expandable

There seems to be an issue with multiple derives in one attribute only showing the expansion of the last derive which I'll have to investigate.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-26 00:39:00 +00:00
Lukas Wirth
3f9f63c1bd Improve expand_macro 2021-08-26 02:36:33 +02:00
Lukas Wirth
1195cb50c2 Add simple test for syntax_node_to_token_tree_censored 2021-08-25 19:57:18 +02:00
bors[bot]
cbbb7f351f
Merge #10024
10024: fix: Fix reporting of build script errors r=matklad a=jonas-schievink

r? `@matklad` (mostly to double-check that the redundant code I removed was, in fact, redundant)

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9864
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10023

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-08-25 17:40:57 +00:00
Lukas Wirth
d6134b6802 Don't mutate syntax trees when preparing proc-macro input 2021-08-25 18:57:24 +02:00
Jonas Schievink
276f6c6ba4 Reduce visibility of WorkspaceBuildScripts::run 2021-08-25 18:02:27 +02:00
Jonas Schievink
0ff2c81bb9 Fix reporting of build script errors 2021-08-25 17:56:39 +02:00
Jonas Schievink
095df7bc39 Don't fetch build script output twice 2021-08-25 17:56:24 +02:00
Aleksey Kladov
d1cd81f387 internal: more declarative re-indentation API 2021-08-24 18:18:43 +03:00
bors[bot]
ce4670f299
Merge #10014
10014: feat: Expand derive macros under cursor in `Expand Macro Recursively` r=Veykril a=Veykril

Expands the derive macros under the cursor if it is one a derive attribute, with this the feature should be basically feature complete I believe(except for the whitespace problem ofc)?

Actually this might interact a bit funky with items that have attributes ***and*** derives since we don't descend the cursor token into macro invocations first, for obvious reasons. So I expected trying to expand a derive in that case will either just expand the attributes on the item or fail in general.

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-24 14:58:02 +00:00
Lukas Wirth
d99b81f839 Expand derive macros under cursor in Expand Macro Recursively 2021-08-24 16:33:52 +02:00
bors[bot]
6287d388c0
Merge #9944
9944: internal: introduce in-place indenting API r=matklad a=iDawer

Introduce `edit_in_place::Indent` that uses mutable tree API and intended to replace `edit::AstNodeEdit`.

Closes #9903 

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-08-24 13:11:50 +00:00
bors[bot]
49c02b93b3
Merge #9993
9993: feat: join lines merges assignments r=matklad a=unexge

Closes https://github.com/rust-analyzer/rust-analyzer/issues/9967.
![Peek 2021-08-22 21-46](https://user-images.githubusercontent.com/16212576/130366571-3ebb1753-f8d5-4884-be8f-222cda71a2a7.gif)


Co-authored-by: unexge <unexge@gmail.com>
2021-08-24 12:14:25 +00:00
bors[bot]
68279e3253
Merge #10011
10011: minor: remove dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-24 11:39:49 +00:00
Aleksey Kladov
4f8c6193d5 minor: remove dead code 2021-08-24 14:39:31 +03:00
bors[bot]
ea5314d59c
Merge #10010
10010: internal: use idiomatic form of assertions r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-24 11:10:09 +00:00
Aleksey Kladov
1660820e51 internal: use idiomatic form of assertions
Ideally, we should just return an InvalidParameter dialog here, but that
shows error message to the end user, and we generally avoid that
2021-08-24 14:09:34 +03:00
bors[bot]
43021525e5
Merge #9994
9994: add static method generation assist r=matklad a=mahdi-frms

Adds feature: #9948

Will soon send a GIF for the changelog.

Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
2021-08-24 09:26:52 +00:00
bors[bot]
fa6a4a0c93
Merge #10008
10008: feat: Highlight declarations and references for both defs in field shorthands r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-24 01:16:44 +00:00
Lukas Wirth
631bca786f Highlight declarations and references for both defs in field shorthands 2021-08-24 03:15:41 +02:00
bors[bot]
ced65f77c4
Merge #10001
10001: Sort enum variant r=Veykril a=vsrs

A small fix to the problem noted by `@lnicola` :

> ![sort-fields](https://user-images.githubusercontent.com/308347/129513196-4ffc7937-be58-44d4-9ec7-ba8745dcb460.gif)
> 
> (note the slight inconsistency here: to sort the variants of `Animal` I have to select the enum name, but to sort the fields of `Cat` I have to select the fields themselves)



Co-authored-by: vsrs <vit@conrlab.com>
2021-08-23 22:19:50 +00:00
bors[bot]
1b28593273
Merge #10004
10004: ⬆️ rowan r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-23 21:23:17 +00:00
Lukas Wirth
d38380715a ⬆️ rowan 2021-08-23 23:22:31 +02:00
bors[bot]
52c9d52c2b
Merge #10003
10003: ⬆️ rowan r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-23 18:19:42 +00:00
Aleksey Kladov
3f2add81fc ⬆️ rowan
This pulls in https://github.com/rust-analyzer/rowan/pull/111, which
fixes a bug in green node hash, making it more efficient.

On analysis stats, total memory goes from 1271mb to 1244mb, instructions
from 358ginstr to 353ginstr (not 100% clear on this one -- for some
reasons instruction counts are not stable for me anymore).

The counts are (before, than after):

rowan::green::node::GreenNode       11_490_596    2_357_063    2_233_347
rowan::green::token::GreenToken      5_010_401      994_281      991_920

rowan::green::node::GreenNode        9_738_085    1_988_164    1_890_549
rowan::green::token::GreenToken      3_353_409      687_333      685_831
                                         total     max_live         live
2021-08-23 21:15:44 +03:00
vsrs
7a8f881a09 Sort enum variant 2021-08-23 20:31:54 +03:00
bors[bot]
dab6e9ff5b
Merge #9999
9999: internal: use single env var to controll all benchmarks r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-23 13:41:12 +00:00
Aleksey Kladov
0a7e57177e internal: use single env var to controll all benchmarks 2021-08-23 16:40:42 +03:00
bors[bot]
9bf8d02345
Merge #9998
9998: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-08-23 10:27:21 +00:00
Laurențiu Nicola
e6d78834dd Bump deps 2021-08-23 13:25:59 +03:00
bors[bot]
df1acf71f8
Merge #9995
9995: ⬆️ rowan r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-23 09:11:32 +00:00
Aleksey Kladov
c044493434 ⬆️ rowan
Just so we don't live on a per-release
2021-08-23 12:10:49 +03:00
mahdi-frms
cf5f1c102c add static method generation assist 2021-08-23 12:14:23 +04:30
unexge
3a9ba0e506 feat: join lines merges assignments 2021-08-22 21:28:39 +03:00
Lukas Wirth
4933beca87 Respect attributes in Hygiene token up-mapping 2021-08-22 19:12:45 +02:00
bors[bot]
996300f4a0
Merge #9989
9989: Fix two more “a”/“an” typos (this time the other way) r=lnicola a=steffahn

Follow-up to #9987

you guys are still merging these fast 😅

_this time I thought – for sure – that I’d get this commit into #9987 before it’s merged…_

Co-authored-by: Frank Steffahn <frank.steffahn@stu.uni-kiel.de>
2021-08-22 16:10:48 +00:00
Frank Steffahn
75073451c6 Fix three more (reverse) “a”/“an” typos 2021-08-22 17:48:15 +02:00
bors[bot]
1c27243f95
Merge #9988
9988: fix: Refactor & improve handling of overloaded binary operators r=flodiebold a=flodiebold

Fixes #9971. Also records them as method resolutions, which we could use later.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-08-22 15:37:06 +00:00
Frank Steffahn
5f5d45468d Fix two more “a”/“an” typos (this time the other way) 2021-08-22 17:36:58 +02:00
Florian Diebold
424dda8113 Refactor & improve handling of overloaded binary operators
Fixes #9971. Also records them as method resolutions, which we could use
later.
2021-08-22 17:35:50 +02:00
bors[bot]
c8fd4fd410
Merge #9987
9987: Fix two more “a”/“an” typos r=lnicola a=steffahn

Follow-up to #9985

you guys are merging these fast 😅 

Co-authored-by: Frank Steffahn <frank.steffahn@stu.uni-kiel.de>
2021-08-22 15:27:39 +00:00
Frank Steffahn
35a7fdd2c1 Fix two more “a”/“an” typos 2021-08-22 17:24:48 +02:00