]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRemove `match_ast!` macro call
BooksBaum [Thu, 19 Aug 2021 12:09:52 +0000 (14:09 +0200)]
Remove `match_ast!` macro call

Add node about uncommenting tuple in macro call

2 years agoAdd deref (`*`) handling for usages of ref tuples
BooksBaum [Tue, 17 Aug 2021 16:18:02 +0000 (18:18 +0200)]
Add deref (`*`) handling for usages of ref tuples

2 years agoSwitch order of assists
BooksBaum [Fri, 13 Aug 2021 17:16:36 +0000 (19:16 +0200)]
Switch order of assists

Destructure in sub-pattern before Destructure in place to favor the
first one

2 years agoAdd generated doctest
BooksBaum [Tue, 10 Aug 2021 12:20:14 +0000 (14:20 +0200)]
Add generated doctest

2 years agoFix errors from `rebase master`
BooksBaum [Tue, 10 Aug 2021 12:15:12 +0000 (14:15 +0200)]
Fix errors from `rebase master`

Note:
2nd Assist description is moved down: generated doc tests extracts now
all tests (previously only the first one). But it uses the first
`Assist` name -- which is the wrong one for the 2nd test. And 2nd assist
is currently disabled -> would fail anyway.

2 years agoCleanup according to style-requirements in tests
BooksBaum [Tue, 10 Aug 2021 11:28:32 +0000 (13:28 +0200)]
Cleanup according to style-requirements in tests

2 years agoFix: different assist ids in doc and code
BooksBaum [Mon, 9 Aug 2021 18:58:33 +0000 (20:58 +0200)]
Fix: different assist ids in doc and code

2 years agoHandle tuple in macro call
BooksBaum [Mon, 9 Aug 2021 17:56:11 +0000 (19:56 +0200)]
Handle tuple in macro call

Only tuple name is handled (uncommented), not tuple index

2 years agoAdd destructure in sub-pattern (after `@`)
BooksBaum [Fri, 6 Aug 2021 08:55:44 +0000 (10:55 +0200)]
Add destructure in sub-pattern (after `@`)

2 years agoHandle `mut` & `ref`
BooksBaum [Wed, 4 Aug 2021 19:16:53 +0000 (21:16 +0200)]
Handle `mut` & `ref`

2 years agoAdd Destructure Tuple
BooksBaum [Tue, 17 Aug 2021 17:22:57 +0000 (19:22 +0200)]
Add Destructure Tuple

2 years agoMerge #9936
bors[bot] [Tue, 17 Aug 2021 16:26:05 +0000 (16:26 +0000)]
Merge #9936

9936: proc_macro_api: make commit & date suffix of binary version optional r=lnicola a=lnicola

Closes #9916

bors r+

Co-authored-by: Florian sp1rit​ <sp1ritCS@protonmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix formatting
Laurențiu Nicola [Tue, 17 Aug 2021 16:25:37 +0000 (19:25 +0300)]
Fix formatting

2 years agoMerge #9934
bors[bot] [Tue, 17 Aug 2021 15:49:02 +0000 (15:49 +0000)]
Merge #9934

9934: Revert "Downgrade notify and use RecommendedWatcher" r=lnicola a=xanderio

This reverts commit 5b0c86af7d1683983a35f232baa7c98cfa3c382d.

The pre-5.0.12 release of notify fixed this issue.

`@lnicola` Could you verify that this now works on NetBSD?

Co-authored-by: Alexander Sieg <alex@xanderio.de>
Co-authored-by: Alexander Sieg <6298052+xanderio@users.noreply.github.com>
2 years agorebuild Cargo.lock
Alexander Sieg [Tue, 17 Aug 2021 15:27:37 +0000 (17:27 +0200)]
rebuild Cargo.lock

2 years agoBump notify version to 5.0.0-pre.12
Alexander Sieg [Tue, 17 Aug 2021 15:25:11 +0000 (17:25 +0200)]
Bump notify version to 5.0.0-pre.12

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2 years agoRevert "Downgrade notify and use RecommendedWatcher"
Alexander Sieg [Tue, 17 Aug 2021 15:17:02 +0000 (17:17 +0200)]
Revert "Downgrade notify and use RecommendedWatcher"

This reverts commit 5b0c86af7d1683983a35f232baa7c98cfa3c382d.

The pre-5.0.12 release of notify fixed this issue.

2 years agoMerge #9929
bors[bot] [Tue, 17 Aug 2021 13:25:08 +0000 (13:25 +0000)]
Merge #9929

9929: fix: Handle all rename special cases for record pattern fields r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoEmit more concise text edits in ide_db::rename
Lukas Wirth [Tue, 17 Aug 2021 13:24:01 +0000 (15:24 +0200)]
Emit more concise text edits in ide_db::rename

2 years agoproc_macro_api: make commit & date suffix of binary version optional
Florian sp1rit​ [Mon, 16 Aug 2021 11:23:53 +0000 (13:23 +0200)]
proc_macro_api: make commit & date suffix of binary version optional

Signed-off-by: Florian "sp1rit"​ <sp1ritCS@protonmail.com>
2 years agosome code docs for the ide_db/rename module
Lukas Wirth [Mon, 16 Aug 2021 21:06:51 +0000 (23:06 +0200)]
some code docs for the ide_db/rename module

2 years agoHandle all rename special cases for all record pattern fields
Lukas Wirth [Mon, 16 Aug 2021 20:48:38 +0000 (22:48 +0200)]
Handle all rename special cases for all record pattern fields

2 years agoMerge #9928
bors[bot] [Mon, 16 Aug 2021 19:26:18 +0000 (19:26 +0000)]
Merge #9928

9928: internal: Highlight function exit points on `fn` keyword r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoHighlight function exit points on `fn` keyword
Lukas Wirth [Mon, 16 Aug 2021 19:25:22 +0000 (21:25 +0200)]
Highlight function exit points on `fn` keyword

2 years agoMerge #9927
bors[bot] [Mon, 16 Aug 2021 19:04:57 +0000 (19:04 +0000)]
Merge #9927

9927: minor: Fix some clippy lints r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix some clippy lints
Laurențiu Nicola [Mon, 16 Aug 2021 19:04:26 +0000 (22:04 +0300)]
Fix some clippy lints

2 years agoMerge #9921
bors[bot] [Mon, 16 Aug 2021 16:38:44 +0000 (16:38 +0000)]
Merge #9921

9921: Only add entries to SourceToDef dynmaps when they come from the same file r=matklad a=Veykril

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

Running the test as described in the issue I do not get any eprintln output at all anymore.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agostyle
Lukas Wirth [Mon, 16 Aug 2021 16:29:16 +0000 (18:29 +0200)]
style

2 years agoMerge #9924
bors[bot] [Mon, 16 Aug 2021 16:25:57 +0000 (16:25 +0000)]
Merge #9924

9924: Fix gen debug for enums r=yoshuawuyts a=yoshuawuyts

Closes https://github.com/rust-analyzer/rust-analyzer/issues/9914. Thanks!

r? `@Veykril`

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2 years agoimplement feedback from review
Yoshua Wuyts [Mon, 16 Aug 2021 16:23:51 +0000 (18:23 +0200)]
implement feedback from review

2 years agoFlatten SourceToDefCache structure
Lukas Wirth [Mon, 16 Aug 2021 15:55:18 +0000 (17:55 +0200)]
Flatten SourceToDefCache structure

2 years agofix debug tuple structs
Yoshua Wuyts [Mon, 16 Aug 2021 15:39:08 +0000 (17:39 +0200)]
fix debug tuple structs

2 years agoOnly add entries to SourceToDef dynmaps when they come from the same file
Lukas Wirth [Mon, 16 Aug 2021 15:07:25 +0000 (17:07 +0200)]
Only add entries to SourceToDef dynmaps when they come from the same file

2 years agoMerge #9920
bors[bot] [Mon, 16 Aug 2021 14:13:04 +0000 (14:13 +0000)]
Merge #9920

9920: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Mon, 16 Aug 2021 14:12:20 +0000 (16:12 +0200)]
Simplify

2 years agoMerge #9918
bors[bot] [Mon, 16 Aug 2021 11:46:21 +0000 (11:46 +0000)]
Merge #9918

9918: minor: simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: simplify
Aleksey Kladov [Mon, 16 Aug 2021 11:45:54 +0000 (14:45 +0300)]
minor: simplify

2 years agoMerge #9917
bors[bot] [Mon, 16 Aug 2021 11:32:43 +0000 (11:32 +0000)]
Merge #9917

9917: minor: remove dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: remove dead code
Aleksey Kladov [Mon, 16 Aug 2021 11:27:36 +0000 (14:27 +0300)]
minor: remove dead code

2 years agofix debug record structs
Yoshua Wuyts [Mon, 16 Aug 2021 10:58:06 +0000 (12:58 +0200)]
fix debug record structs

2 years agoMerge #9905
bors[bot] [Sun, 15 Aug 2021 10:26:59 +0000 (10:26 +0000)]
Merge #9905

9905: internal: optimize compile time r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: optimize compile time
Aleksey Kladov [Sun, 15 Aug 2021 10:24:37 +0000 (13:24 +0300)]
internal: optimize compile time

cargo llvm-lines shows that path_to_error bloats the code. I don't think
I've needed this functionality recently, seems that we've fixed most of
the serialization problems. So let's just remove it. Should be easy to
add back if we ever need it, and it does make sense to keep the
`from_json` function around.

2 years agoMerge #9902
bors[bot] [Sat, 14 Aug 2021 17:43:52 +0000 (17:43 +0000)]
Merge #9902

9902: minor: move functionality to a better place r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: move functionality to a better place
Aleksey Kladov [Sat, 14 Aug 2021 17:38:31 +0000 (20:38 +0300)]
minor: move functionality to a better place

2 years agoMerge #9901
bors[bot] [Sat, 14 Aug 2021 17:30:13 +0000 (17:30 +0000)]
Merge #9901

9901: internal: remove dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: remove dead code
Aleksey Kladov [Sat, 14 Aug 2021 17:29:46 +0000 (20:29 +0300)]
internal: remove dead code

2 years agoMerge #9900
bors[bot] [Sat, 14 Aug 2021 17:17:51 +0000 (17:17 +0000)]
Merge #9900

9900: internal: remove one more usage of old editing API. r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: remove one more usage of old editing API.
Aleksey Kladov [Sat, 14 Aug 2021 17:17:16 +0000 (20:17 +0300)]
internal: remove one more usage of old editing API.

2 years agoMerge #9899
bors[bot] [Sat, 14 Aug 2021 17:10:04 +0000 (17:10 +0000)]
Merge #9899

9899: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sat, 14 Aug 2021 17:06:35 +0000 (19:06 +0200)]
Simplify

2 years agoMerge #9897
bors[bot] [Sat, 14 Aug 2021 16:46:19 +0000 (16:46 +0000)]
Merge #9897

9897: internal: remove old editing API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: remove old editing API
Aleksey Kladov [Sat, 14 Aug 2021 16:45:47 +0000 (19:45 +0300)]
internal: remove old editing API

2 years agoMerge #9896
bors[bot] [Sat, 14 Aug 2021 16:19:14 +0000 (16:19 +0000)]
Merge #9896

9896: internal: Only complete type annotations for patterns in function params r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoOnly complete type annotations for patterns in function params
Lukas Wirth [Sat, 14 Aug 2021 16:18:18 +0000 (18:18 +0200)]
Only complete type annotations for patterns in function params

2 years agoMerge #9895
bors[bot] [Sat, 14 Aug 2021 16:07:09 +0000 (16:07 +0000)]
Merge #9895

9895: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sat, 14 Aug 2021 16:02:51 +0000 (18:02 +0200)]
Simplify

2 years agoMerge #9894
bors[bot] [Sat, 14 Aug 2021 15:59:47 +0000 (15:59 +0000)]
Merge #9894

9894: internal: use standard test style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: use standard test style
Aleksey Kladov [Sat, 14 Aug 2021 15:53:21 +0000 (18:53 +0300)]
internal: use standard test style

2 years agoMerge #9893
bors[bot] [Sat, 14 Aug 2021 15:52:48 +0000 (15:52 +0000)]
Merge #9893

9893: fix: Don't use uncached syntax nodes in `generate_function` for sema lookups r=Veykril a=Veykril

Fixes the crash in the comment here https://github.com/rust-analyzer/rust-analyzer/issues/9382#issuecomment-896101298
Couldn't make out a repro test for this unfortunately
still not idea about the original issue

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't use non cache syntaxnodes in generate_function for lookups
Lukas Wirth [Sat, 14 Aug 2021 15:42:06 +0000 (17:42 +0200)]
Don't use non cache syntaxnodes in generate_function for lookups

2 years agoMerge #9892
bors[bot] [Sat, 14 Aug 2021 15:40:20 +0000 (15:40 +0000)]
Merge #9892

9892: internal: remove a remnant of old editing infra r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: make assist naming consistent
Aleksey Kladov [Sat, 14 Aug 2021 15:28:38 +0000 (18:28 +0300)]
internal: make assist naming consistent

2 years agointernal: remove a remnant of old editing infra
Aleksey Kladov [Sat, 14 Aug 2021 15:24:42 +0000 (18:24 +0300)]
internal: remove a remnant of old editing infra

2 years agoMerge #9890
bors[bot] [Sat, 14 Aug 2021 15:11:17 +0000 (15:11 +0000)]
Merge #9890

9890: internal: refactor binary operator handling r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: merge hir::BinaryOp and ast::BinOp
Aleksey Kladov [Sat, 14 Aug 2021 15:08:31 +0000 (18:08 +0300)]
internal: merge hir::BinaryOp and ast::BinOp

2 years agointernal: prepare to merge hir::BinaryOp and ast::BinOp
Aleksey Kladov [Sat, 14 Aug 2021 14:07:51 +0000 (17:07 +0300)]
internal: prepare to merge hir::BinaryOp and ast::BinOp

2 years agointernal: make naming consistent
Aleksey Kladov [Sat, 14 Aug 2021 14:01:28 +0000 (17:01 +0300)]
internal: make naming consistent

2 years agointernal: prepare a dedicated module for all operators
Aleksey Kladov [Sat, 14 Aug 2021 13:58:46 +0000 (16:58 +0300)]
internal: prepare a dedicated module for all operators

2 years agoMerge #9889
bors[bot] [Sat, 14 Aug 2021 13:41:00 +0000 (13:41 +0000)]
Merge #9889

9889: Update manual.adoc: added juCi++ section r=lnicola a=eidheim

Co-authored-by: Ole Christian Eidheim <eidheim@gmail.com>
2 years agointernal: make invert binary op more robust
Aleksey Kladov [Sat, 14 Aug 2021 13:40:00 +0000 (16:40 +0300)]
internal: make invert binary op more robust

Previously, we only inverted comparison operators (< and the like) if
the type implemented Ord. This doesn't make sense: if `<` works, then
`>=` will work as well!

Extra semantic checks greatly reduce robustness and predictability of
the assist, it's better to keep things simple.

2 years agoUpdate manual.adoc: added juCi++ section
Ole Christian Eidheim [Sat, 14 Aug 2021 10:47:58 +0000 (12:47 +0200)]
Update manual.adoc: added juCi++ section

2 years agoMerge #9882
bors[bot] [Sat, 14 Aug 2021 07:39:46 +0000 (07:39 +0000)]
Merge #9882

9882: fix: Don't call deprecated `compile` regex method r=lnicola a=lnicola

Fixes #9872

It looks like `compile` expects to be called like `RegExp.compile("foo", "m")`, so calling `.compile()` on an existing regex replaces it with an empty one.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #9886
bors[bot] [Fri, 13 Aug 2021 22:12:58 +0000 (22:12 +0000)]
Merge #9886

9886: feat: type inference for if-let guards r=jonas-schievink a=jonas-schievink

This turned out fairly simple

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agofeat: type inference for if-let guards
Jonas Schievink [Fri, 13 Aug 2021 22:09:30 +0000 (00:09 +0200)]
feat: type inference for if-let guards

2 years agoMerge #9884
bors[bot] [Fri, 13 Aug 2021 15:24:35 +0000 (15:24 +0000)]
Merge #9884

9884: cargo update r=kjeremy a=kjeremy

Remove paste-impl and proc-macro-hack.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2 years agocargo update
Jeremy Kolb [Fri, 13 Aug 2021 15:08:24 +0000 (11:08 -0400)]
cargo update

2 years agoMerge #9871
bors[bot] [Fri, 13 Aug 2021 11:19:16 +0000 (11:19 +0000)]
Merge #9871

9871: Jump to generated func r=mahdi-frms a=rylev

Worked on this with `@yoshuawuyts.`

We thought we ran into an issue with the `generate_function` assist where the code was not being generated in a certain situations. However, it wasn't actually a bug just a very confusing implementation where the cursor is not moved to the newly generated function. This happened when the return type was successfully inferred (and not unit). The function would be generated, but selection would not be changed.

This can be very confusing: If the function is generated somewhat far from where the assist is being invoked, the user never sees that the code was generated (nor are they given the chance to actually implement the function body).

This PR makes it so that the cursor is _always_ moved to somewhere in the newly generated function. In addition, if we can infer unit as the type, then we do not still generate `-> ()` as the return type. Instead, we simply omit the return type.

This means the selection will move to either one of two places:
* A generated `-> ()` return type when we cannot successfully infer the return type.
* The `todo!()` body when we can successfully infer the return type.

Co-authored-by: Ryan Levick <me@ryanlevick.com>
2 years agoDon't call deprecated compile regex method
Laurențiu Nicola [Fri, 13 Aug 2021 11:16:33 +0000 (14:16 +0300)]
Don't call deprecated compile regex method

2 years agoAdd documentation on how whether a generated return type should be focused or not
Ryan Levick [Fri, 13 Aug 2021 09:44:29 +0000 (11:44 +0200)]
Add documentation on how whether a generated return type should be focused or not

2 years agoMerge #9879
bors[bot] [Thu, 12 Aug 2021 22:28:04 +0000 (22:28 +0000)]
Merge #9879

9879: feat: Support `if let` match guards r=jonas-schievink a=jonas-schievink

Adds support for parsing and computing bindings for `if let` match guards (https://github.com/rust-lang/rust/issues/51114). Type inference support is still missing, but shouldn't be hard to add in a follow-up PR.

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoSupport `if let` match guards
Jonas Schievink [Thu, 12 Aug 2021 22:21:42 +0000 (00:21 +0200)]
Support `if let` match guards

2 years agoMerge #9874
bors[bot] [Thu, 12 Aug 2021 19:45:06 +0000 (19:45 +0000)]
Merge #9874

9874: fix: Always add implicit `proc_macro` dependency r=jonas-schievink a=jonas-schievink

Even crates that don't set `proc-macro = true` are allowed to depend on `proc_macro` (just none of the APIs work when called outside of a proc macro).

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoAlways add implicit `proc_macro` dependency
Jonas Schievink [Thu, 12 Aug 2021 19:42:14 +0000 (21:42 +0200)]
Always add implicit `proc_macro` dependency

2 years agoMerge #9807
bors[bot] [Thu, 12 Aug 2021 17:55:29 +0000 (17:55 +0000)]
Merge #9807

9807: Implicit `Sized` bounds r=iDawer a=iDawer

This should close #8984

`hir_ty`:
- Type parameters, associated types and `impl Trait` are `Sized` by deafault except `Self` in a trait.
- Implicit `Sized` bound is added to end of predicate list. It does not check if such bound is present already. Also it does not track the bound is implicit.
- Allowed ambiguous unsize coercion if Chalk returns definite guidance.
- Allowed ambiguous autoderef if Chalk returns definite guidance.

`hir_def`:
- `ItemTree` pretty printing shows `?Sized` bounds.

`HirDisplay`:
- `impl Trait` with weird bounds rendered correctly.
- `Sized`/`?Sized` bounds are not shown if they are default.

### Perf
`./target/rust-analyzer-baseline_8a843113 -q analysis-stats --memory-usage .`
```
Database loaded:     1.63s, 287minstr, 91mb
  crates: 38, mods: 741, decls: 15914, fns: 11835
Item Collection:     26.80s, 73ginstr, 338mb
  exprs: 318994, ??ty: 398 (0%), ?ty: 435 (0%), !ty: 174
Inference:           50.28s, 116ginstr, 516mb
Total:               77.08s, 189ginstr, 855mb
```

`./target/rust-analyzer-sized-fixed_ambig_coercion-de074fe6 -q analysis-stats --memory-usage .`
```
Database loaded:     1.63s, 287minstr, 91mb
  crates: 38, mods: 741, decls: 15914, fns: 11835
Item Collection:     26.95s, 73ginstr, 338mb
  exprs: 318994, ??ty: 398 (0%), ?ty: 435 (0%), !ty: 166
Inference:           96.39s, 234ginstr, 543mb
Total:               123.33s, 307ginstr, 881mb
```

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2 years agoClean up
Dawer [Thu, 12 Aug 2021 14:31:00 +0000 (19:31 +0500)]
Clean up

2 years agoFactor out return type handling for both function and method
Ryan Levick [Thu, 12 Aug 2021 14:05:32 +0000 (16:05 +0200)]
Factor out return type handling for both function and method

2 years agoAlways fall back to focusing on generated function body
Ryan Levick [Thu, 12 Aug 2021 12:56:39 +0000 (14:56 +0200)]
Always fall back to focusing on generated function body

2 years agoMerge #9869
bors[bot] [Thu, 12 Aug 2021 12:11:09 +0000 (12:11 +0000)]
Merge #9869

9869: Use term "method" on label for generating method impl r=Veykril a=rylev

When showing the user the `generate_function` assist, use the term "method" when generating a method instead of the term "function" (which is correct but maybe not the most appropriate in that context).

Co-authored-by: Ryan Levick <me@ryanlevick.com>
2 years agoUse term on label for generating method impl
Ryan Levick [Thu, 12 Aug 2021 11:59:08 +0000 (13:59 +0200)]
Use term  on label for generating method impl

2 years agoMerge #9863
bors[bot] [Thu, 12 Aug 2021 10:18:02 +0000 (10:18 +0000)]
Merge #9863

9863: feat: Generate default trait fn impl when generating `PartialEq` r=yoshuawuyts a=yoshuawuyts

Implements a default trait function body when generating the `PartialEq` trait for a type. Thanks!

r? `@veykril`

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2 years agoadd `make::ext::path_from_idents`
Yoshua Wuyts [Thu, 12 Aug 2021 10:17:09 +0000 (12:17 +0200)]
add `make::ext::path_from_idents`

2 years agoimplement feedback from review
Yoshua Wuyts [Thu, 12 Aug 2021 09:50:01 +0000 (11:50 +0200)]
implement feedback from review

2 years agorm remaining todo comment
Yoshua Wuyts [Wed, 11 Aug 2021 21:30:00 +0000 (23:30 +0200)]
rm remaining todo comment

2 years agoimprove codegen
Yoshua Wuyts [Wed, 11 Aug 2021 18:33:13 +0000 (20:33 +0200)]
improve codegen

2 years agofinishing touches
Yoshua Wuyts [Wed, 11 Aug 2021 18:04:05 +0000 (20:04 +0200)]
finishing touches

2 years agogen partialeq for tuple enums
Yoshua Wuyts [Wed, 11 Aug 2021 18:01:19 +0000 (20:01 +0200)]
gen partialeq for tuple enums

2 years agodedup PartialEq for Record enums
Yoshua Wuyts [Wed, 11 Aug 2021 17:40:47 +0000 (19:40 +0200)]
dedup PartialEq for Record enums

2 years agoAccept ambiguous unsize coercion only if it has definite guidance.
Dawer [Wed, 11 Aug 2021 17:09:32 +0000 (22:09 +0500)]
Accept ambiguous unsize coercion only if it has definite guidance.

2 years agoMerge #9862
bors[bot] [Wed, 11 Aug 2021 16:13:29 +0000 (16:13 +0000)]
Merge #9862

9862: internal: Fill out expected type for functional update syntax completion r=Veykril a=Veykril

Last part of https://github.com/rust-analyzer/rust-analyzer/issues/9839
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFill out expected type for functional update syntax completion
Lukas Wirth [Wed, 11 Aug 2021 16:05:39 +0000 (18:05 +0200)]
Fill out expected type for functional update syntax completion