Commit graph

17995 commits

Author SHA1 Message Date
Lukas Wirth
14e18bfa38 Merge the inline function/method assists into inline_call 2021-07-03 18:07:03 +02:00
Lukas Wirth
688398febc feat: Implement inline_method assist 2021-07-03 01:33:34 +02:00
Lukas Wirth
fbdcb49d48 Simplify 2021-07-03 01:31:41 +02:00
Lukas Wirth
26dd0c4e5b wrap_return_type_in_result works on the HIR 2021-07-02 23:19:32 +02:00
bors[bot]
3770fce086
Merge #9465
9465: feat: `replace_match_with_if_let` works on more 2-arm matches r=Veykril a=Veykril

Now it works on pretty much on all 2-arm matches where only up to 1 arm binds a name instead of requiring either a sad or wildcard pattern to be present.

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-02 19:11:08 +00:00
Lukas Wirth
eb3f90b301 Don't check sad pattern equality by text 2021-07-02 21:10:44 +02:00
Lukas Wirth
251f0c6090 replace_match_with_if_let works on more binary matches 2021-07-02 21:05:10 +02:00
Lukas Wirth
f1819525f5 Simplify 2021-07-02 19:50:37 +02:00
Lukas Wirth
a7d61ddba4 Add cov_mark 2021-07-02 19:34:49 +02:00
bors[bot]
dd69d4a97c
Merge #9464
9464: fix: Fix runnables using wrong file ids for module doctests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-02 13:51:57 +00:00
Lukas Wirth
59eec29e1b Fix runnables using wrong file ids for module doctests 2021-07-02 15:43:47 +02:00
bors[bot]
a8563c5942
Merge #9463
9463: fix: Remove incorrect std dep r=jonas-schievink a=jonas-schievink

libstd doesn't actually depend on `proc_macro`. cc https://github.com/rust-analyzer/rust-analyzer/pull/9456#issuecomment-873005974

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-02 13:43:40 +00:00
Jonas Schievink
3fa07b31c9 Remove incorrect std dep 2021-07-02 15:42:42 +02:00
bors[bot]
021f6772e4
Merge #9462
9462: minor: Print runnable kind on assertion failure for better debuggability r=Veykril a=Veykril

We are somehow hitting this when looking at `crates\ide_db\src\lib.rs` and I don't see how.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-02 13:35:13 +00:00
Lukas Wirth
0b8e145641 Print runnable kind on assertion failure for better debuggability 2021-07-02 15:34:26 +02:00
bors[bot]
cd7277efac
Merge #9461
9461: fix: Fix incorrect guard for NameRefClass attribute resolution r=Veykril a=Veykril

This is what happens when you forget to write a test
bors r+


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-02 13:19:12 +00:00
Lukas Wirth
f640f2dbb4 Fix incorrect guard for NameRefClass attribute resolution 2021-07-02 15:17:21 +02:00
bors[bot]
16871f6f93
Merge #9428
9428: fix: Fix deduction of `dyn Fn` closure parameter types r=flodiebold a=jonas-schievink



Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-02 12:49:34 +00:00
bors[bot]
d18cfd4467
Merge #9458
9458: minor: Remove make::match_arm_with_guard r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 23:47:38 +00:00
Lukas Wirth
071ac48b6c Remove make::match_arm_with_guard 2021-07-02 01:44:54 +02:00
bors[bot]
bd4f83d9f1
Merge #9456
9456: fix: sysroot: add proc_macro -> std dependency edge r=jonas-schievink a=jonas-schievink

This fixes missing trait implementation on the proc_macro types.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 23:39:59 +00:00
Jonas Schievink
be0f1d5ca6 sysroot: add proc_macro -> std dependency edge 2021-07-02 01:38:49 +02:00
bors[bot]
cd3d633850
Merge #9455
9455: feat: Handle not let if expressions in replace_if_let_with_match r=Veykril a=Veykril

Transforms bare `if cond {}` into `_ if cond` guard patterns in the match as long as at least one `if let` is in the if chain, otherwise the assist wont be applicable.

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 23:00:50 +00:00
Lukas Wirth
8967856d78 Handle not let if expressions in replace_if_let_with_match 2021-07-02 00:58:56 +02:00
bors[bot]
51d85e1060
Merge #9454
9454: feat: Empower `replace_if_let_with_match` r=Veykril a=Veykril

Now instead of only working on `if let ... {} else {}` if expressions it now works on all of them where the condition expression is the same text-wise.

This includes if let expressions without an else block, in which case a simple `_ => ()` will be generated in the resulting match but also in more complex cases where multiple `if let` expressions are chained.

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 22:24:17 +00:00
Lukas Wirth
20be999304 Empower replace_if_let_with_match 2021-07-02 00:21:21 +02:00
Jonas Schievink
835d1cec59 Substitute self type instead of fusing binders 2021-07-02 00:16:36 +02:00
bors[bot]
334c7eba8d
Merge #9452
9452: feat: Add "View Crate Graph (Full)" r=jonas-schievink a=jonas-schievink

Works like "View Crate Graph", but also includes crates.io and sysroot dependencies. The resulting graph might be enormous.

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 22:12:53 +00:00
Jonas Schievink
5f13fb9db9 Add "View Crate Graph (Full)" 2021-07-02 00:10:33 +02:00
bors[bot]
0331d19f42
Merge #9451
9451: minor: Add `goto_type_action` for field hovers r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 19:52:14 +00:00
Lukas Wirth
81762024b5 Add goto_type_action for field hovers 2021-07-01 21:51:26 +02:00
bors[bot]
564fa0146e
Merge #9450
9450: internal: Add ModuleOrItem guess to import granularity guessing r=Veykril a=Veykril

I think this should be the last fix needed for this(🤞)
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 19:33:53 +00:00
Lukas Wirth
7c8ef301ca Add ModuleOrItem guess to import granularity guessing 2021-07-01 21:32:35 +02:00
Lukas Wirth
3d2490ca97 Simplify 2021-07-01 21:10:45 +02:00
Jonas Schievink
cee9a7e26a Bind the right number of variables in the FnPointer 2021-07-01 20:54:25 +02:00
Jonas Schievink
e6fdb38d38 Use as_tuple() 2021-07-01 20:45:47 +02:00
bors[bot]
738dd6ed9f
Merge #9431
9431: internal: Implement TypeRef::ForLifetime r=flodiebold a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 18:25:06 +00:00
bors[bot]
76d8f55952
Merge #9447
9447: fix: Make unlinked_file diagnostic a hint again r=jonas-schievink a=jonas-schievink

#9255 accidentally turned it into an error

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 17:58:40 +00:00
Jonas Schievink
69dce13ddd Make unlinked_file diagnostic a hint again 2021-07-01 19:57:50 +02:00
bors[bot]
920b2c8630
Merge #9445
9445: fix: Fix nested macro in block defining items r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8930

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 17:21:34 +00:00
Jonas Schievink
28e4b10f46 Fix nested macro in block defining items 2021-07-01 19:20:42 +02:00
bors[bot]
a0b8448b09
Merge #9443
9443: internal: Add a simpler legacy macro scoping test r=jonas-schievink a=jonas-schievink

This is a lot simpler to understand and debug than the `plain_macros_are_legacy_textual_scoped` test.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 15:29:28 +00:00
Jonas Schievink
33d5793f19 Add a simpler legacy macro scoping test 2021-07-01 17:28:42 +02:00
bors[bot]
e8b9f43084
Merge #9440
9440: Don't implement `Eq` for `CrateGraph` r=kjeremy a=lnicola

This currently seems [incorrect](https://github.com/rust-analyzer/rust-analyzer/pull/8363/files) and doesn't seem that useful, so maybe we can remove it?

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-07-01 12:05:46 +00:00
Laurențiu Nicola
cf9d93a5d6 Don't implement Eq for CrateGraph 2021-07-01 14:10:57 +03:00
bors[bot]
c8c4d73648
Merge #9437
9437: fix: Don't classify paths inside attribute TokenTrees r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-30 19:52:03 +00:00
Lukas Wirth
04f1104179 Don't classify NameRef paths inside attribute TokenTrees 2021-06-30 21:51:28 +02:00
bors[bot]
2f9645501c
Merge #9436
9436: minor: Add test for macro expanded test module in runnables r=Veykril a=Veykril

Expected this to fail as thats behaving incorrectly on current nightly but I think I fixed this accidentally with https://github.com/rust-analyzer/rust-analyzer/pull/9435
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-30 17:37:28 +00:00
Lukas Wirth
8d3a378de9 Add test for macro expanded test module in runnables 2021-06-30 19:35:58 +02:00
bors[bot]
3c42aefceb
Merge #9435
9435: fix: Don't add test runnables for outline modules in the wrong file r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-30 17:11:34 +00:00