]>
git.lizzy.rs Git - rust.git/log
Jonas Schievink [Tue, 8 Jun 2021 14:42:48 +0000 (16:42 +0200)]
source_to_def: skip items with no def
Aleksey Kladov [Tue, 8 Jun 2021 12:31:36 +0000 (15:31 +0300)]
Revert "Merge #9177"
This reverts commit
f1818cb7ba2808cba3fd9bf8f199c382060a1f19 , reversing
changes made to
6c9362d61b895c11b1d0cf6837ada9f2a0a30eaf .
This broke things
bors[bot] [Tue, 8 Jun 2021 11:00:19 +0000 (11:00 +0000)]
Merge #9177
9177: :arrow_up: npm packages r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 8 Jun 2021 10:55:20 +0000 (13:55 +0300)]
:arrow_up: npm packages
bors[bot] [Tue, 8 Jun 2021 10:53:20 +0000 (10:53 +0000)]
Merge #9153
9153: QOL: VSCode status bar icon on click now shows server status r=matklad a=Milo123459
Now, when you click the little status bar text, it will automatically reload the server. I don't think I've ever seen anyone click it randomly, and, it's there to save you a few clicks.
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
bors[bot] [Mon, 7 Jun 2021 18:46:18 +0000 (18:46 +0000)]
Merge #9171
9171: internal: simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 7 Jun 2021 18:45:17 +0000 (20:45 +0200)]
simplify
bors[bot] [Mon, 7 Jun 2021 17:47:23 +0000 (17:47 +0000)]
Merge #9170
9170: internal: Remove unnecessary `completion::macro_in_item_position` module r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 7 Jun 2021 17:35:24 +0000 (19:35 +0200)]
Remove unnecessary completion::macro_in_item_position
bors[bot] [Mon, 7 Jun 2021 17:37:48 +0000 (17:37 +0000)]
Merge #9169
9169: internal: steps towards attribute macro token mapping r=jonas-schievink a=jonas-schievink
This doesn't work yet, but we seem to be getting a bit further along (for example, we now stop highlighting `use` items inside item with attribute macros as if they were written verbatim).
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 7 Jun 2021 17:32:28 +0000 (19:32 +0200)]
Attempt to track attr macros during highlighting
Lukas Wirth [Mon, 7 Jun 2021 17:06:03 +0000 (19:06 +0200)]
Reorder CompletionContext fields
Milo [Mon, 7 Jun 2021 16:56:40 +0000 (17:56 +0100)]
fix
bors[bot] [Mon, 7 Jun 2021 16:17:14 +0000 (16:17 +0000)]
Merge #9144
9144: Extend convert_tuple_struct_to_named_struct to also apply to enum tuple variants r=matklad a=joshuawarner32
This is largely copied and adapted from the existing `convert_tuple_struct_to_named_struct` code.
Not sure if maybe some of this code can/should be shared between those two assists - but the differences are significant enough to make it at least seem like a non-trivial refactor.
Co-authored-by: Joshua Warner <joshuawarner32@gmail.com>
bors[bot] [Mon, 7 Jun 2021 15:49:50 +0000 (15:49 +0000)]
Merge #9166
9166: Clarify label documentation r=matklad a=flodiebold
Also some other cleanups while I'm there.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Jonas Schievink [Mon, 7 Jun 2021 14:05:36 +0000 (16:05 +0200)]
Make "expand macro" command work with attribute macros
Florian Diebold [Mon, 7 Jun 2021 12:50:03 +0000 (14:50 +0200)]
Further clarification
Florian Diebold [Mon, 7 Jun 2021 12:43:58 +0000 (14:43 +0200)]
One additional grammar fix
Florian Diebold [Mon, 7 Jun 2021 12:34:41 +0000 (14:34 +0200)]
Clarify label documentation
Also some other cleanups while I'm there.
bors[bot] [Mon, 7 Jun 2021 12:17:28 +0000 (12:17 +0000)]
Merge #9164
9164: internal: Reduce the number of direct fields in `CompletionContext` some more r=Veykril a=Veykril
Doesn't make the code much simpler yet.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 7 Jun 2021 10:29:46 +0000 (12:29 +0200)]
Move more things into PathCompletionContext
bors[bot] [Mon, 7 Jun 2021 10:33:13 +0000 (10:33 +0000)]
Merge #9161
9161: Fix incorrect config usage in hover references r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 7 Jun 2021 10:32:25 +0000 (12:32 +0200)]
Fix incorrect config usage in hover references
bors[bot] [Mon, 7 Jun 2021 09:59:32 +0000 (09:59 +0000)]
Merge #9160
9160: internal: make `Documentation::new` non-generic r=lnicola a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Mon, 7 Jun 2021 09:58:51 +0000 (12:58 +0300)]
Make Documentation::new non-generic
bors[bot] [Mon, 7 Jun 2021 07:40:52 +0000 (07:40 +0000)]
Merge #9157
9157: minor: Use HTTPS for clippy lint JSON r=lnicola a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Mon, 7 Jun 2021 07:40:12 +0000 (10:40 +0300)]
Use HTTPS for clippy lint JSON
bors[bot] [Mon, 7 Jun 2021 04:52:38 +0000 (04:52 +0000)]
Merge #9106
9106: feat: goto definition on an impl fn goes to that fn in the trait r=lf- a=lf-
e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.
![ra goto def trait the other way](https://user-images.githubusercontent.com/
6652840 /
120403989 -
39aa3280 -c2fa-11eb-9359-
639346878acd .gif)
Co-authored-by: Jade <software@lfcode.ca>
Jade [Mon, 7 Jun 2021 04:48:06 +0000 (21:48 -0700)]
feat: goto def on impl items also goes to the defn in the trait
It was trivial to extend this to associated consts/associated types and
I just didn't think of it.
Jade [Tue, 1 Jun 2021 23:16:59 +0000 (16:16 -0700)]
feat: goto definition on an impl fn goes to that fn in the trait
e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.
Lukas Wirth [Sun, 6 Jun 2021 18:02:26 +0000 (20:02 +0200)]
Simplify CompletionContext by introducing a path CallKind enum
Jonas Schievink [Sun, 6 Jun 2021 13:51:05 +0000 (15:51 +0200)]
Handle attribute macros in `descend_into_macros`
bors[bot] [Sun, 6 Jun 2021 14:50:06 +0000 (14:50 +0000)]
Merge #9155
9155: internal: replace attribute with equivalent whitespace r=jonas-schievink a=jonas-schievink
This is needed to that the `TokenMap` we create contains offsets that match the source. Currently the offsets don't match because the attribute is removed, shifting all subsequent token offsets by the attribute's text length.
Currently this fix has no visible effect because we don't remap tokens in attribute macros.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Sun, 6 Jun 2021 13:51:49 +0000 (15:51 +0200)]
Replace attribute with equivalent whitespace
This is needed to that the `TokenMap` we create contains offsets that
match the source.
Joshua Warner [Sun, 6 Jun 2021 00:09:56 +0000 (17:09 -0700)]
fmt
Milo [Sat, 5 Jun 2021 23:21:50 +0000 (00:21 +0100)]
fix
Milo [Sat, 5 Jun 2021 23:17:16 +0000 (00:17 +0100)]
when you click status bar icon it now restarts server
Joshua Warner [Sat, 5 Jun 2021 22:29:29 +0000 (15:29 -0700)]
Refactor to be just one assist
bors[bot] [Sat, 5 Jun 2021 19:26:33 +0000 (19:26 +0000)]
Merge #9149
9149: feat: Support goto-definition for include macros input path r=Veykril a=Veykril
![0l6l9iWPNE](https://user-images.githubusercontent.com/
3757771 /
120891155 -
3fa85800 -c607-11eb-9b20-
7ac330dceb4b .gif)
Fixes #5871
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Sat, 5 Jun 2021 18:16:57 +0000 (18:16 +0000)]
Merge #9150
9150: Unescape generated clippy lints r=lnicola a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Sat, 5 Jun 2021 17:23:40 +0000 (17:23 +0000)]
Merge #9140
9140: feat: Render documentation for derive completion r=Veykril a=Veykril
![eEzGiq2wNa](https://user-images.githubusercontent.com/
3757771 /
120847308 -
9c5a3300 -c573-11eb-958d-
e0f22f4757ed .gif)
Nothing fancy as all the std derives aren't really documented though maybe some 3rd party crates document them equally to their trait counterparts.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 5 Jun 2021 17:14:53 +0000 (19:14 +0200)]
Unescape generated clippy lints
Lukas Wirth [Sat, 5 Jun 2021 12:02:36 +0000 (14:02 +0200)]
Support goto-definition for include macro paths
bors[bot] [Sat, 5 Jun 2021 12:29:52 +0000 (12:29 +0000)]
Merge #9147
9147: internal: enable proc macros and build scripts in cli r=flodiebold a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Sat, 5 Jun 2021 11:03:56 +0000 (14:03 +0300)]
Enable proc macros and build scripts by default in CLI
bors[bot] [Sat, 5 Jun 2021 11:16:46 +0000 (11:16 +0000)]
Merge #9148
9148: minor: Prevent renaming of aliases on usages r=Veykril a=Veykril
Otherwise trying to rename a usage that goes through an alias will still rename the aliased item instead, cc https://github.com/rust-analyzer/rust-analyzer/issues/5671
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 5 Jun 2021 11:15:07 +0000 (13:15 +0200)]
Prevent renaming of aliases on usages
bors[bot] [Sat, 5 Jun 2021 10:44:36 +0000 (10:44 +0000)]
Merge #9146
9146: minor: Fix incorrect list nesting in format_like feature description r=Veykril a=Veykril
bors r+
Closes #6261
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 5 Jun 2021 10:43:45 +0000 (12:43 +0200)]
Fix incorrect list nesting in format_like feature description
bors[bot] [Sat, 5 Jun 2021 09:32:40 +0000 (09:32 +0000)]
Merge #9145
9145: internal: Enable attribute macro expansion in `analysis-stats` r=flodiebold a=flodiebold
Before:
```
> $ rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded: 19.08s, 277minstr
crates: 34, mods: 688, decls: 13202, fns: 10412
Item Collection: 16.21s, 76ginstr
exprs: 290580, ??ty: 2508 (0%), ?ty: 1814 (0%), !ty: 947
Inference: 27.46s, 108ginstr
Total: 43.67s, 184ginstr
```
After:
```
> $ ./target/release/rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded: 1.09s, 277minstr
crates: 34, mods: 688, decls: 14790, fns: 11006
Item Collection: 18.20s, 78ginstr
exprs: 297826, ??ty: 493 (0%), ?ty: 558 (0%), !ty: 342
Inference: 28.34s, 111ginstr
Total: 46.54s, 190ginstr
```
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Sat, 5 Jun 2021 09:29:24 +0000 (11:29 +0200)]
Enable attribute macro expansion in `analysis-stats`
Before:
```
> $ rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded: 19.08s, 277minstr
crates: 34, mods: 688, decls: 13202, fns: 10412
Item Collection: 16.21s, 76ginstr
exprs: 290580, ??ty: 2508 (0%), ?ty: 1814 (0%), !ty: 947
Inference: 27.46s, 108ginstr
Total: 43.67s, 184ginstr
```
After:
```
> $ ./target/release/rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded: 1.09s, 277minstr
crates: 34, mods: 688, decls: 14790, fns: 11006
Item Collection: 18.20s, 78ginstr
exprs: 297826, ??ty: 493 (0%), ?ty: 558 (0%), !ty: 342
Inference: 28.34s, 111ginstr
Total: 46.54s, 190ginstr
```
Joshua Warner [Sat, 5 Jun 2021 04:48:32 +0000 (21:48 -0700)]
Add assist for converting a tuple enum variant to a named variant
Lukas Wirth [Fri, 4 Jun 2021 19:07:19 +0000 (21:07 +0200)]
Complete third-party attributes
Lukas Wirth [Fri, 4 Jun 2021 18:25:16 +0000 (20:25 +0200)]
Render documentation for derive completion
bors[bot] [Fri, 4 Jun 2021 18:44:22 +0000 (18:44 +0000)]
Merge #9141
9141: fix: Don't inline mutable locals in 'inline_local_variable' r=Veykril a=Veykril
Fixes #9139
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 4 Jun 2021 18:36:43 +0000 (20:36 +0200)]
Don't inline mutable locals in 'inline_local_variable'
bors[bot] [Fri, 4 Jun 2021 17:45:37 +0000 (17:45 +0000)]
Merge #9138
9138: feat: Implement hover for lints r=Veykril a=Veykril
fixes https://github.com/rust-analyzer/rust-analyzer/issues/8857, fixes https://github.com/rust-analyzer/rust-analyzer/issues/3941
![URXBanNxYe](https://user-images.githubusercontent.com/
3757771 /
120830905 -
4bd8da80 -c55f-11eb-9f55-
ff5a321726fa .gif)
We also generate the default lints(and lint groups 🎉) instead now by invoking `rustc -W help` and parsing the output from that.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 4 Jun 2021 17:18:45 +0000 (19:18 +0200)]
Exclude `crates/ide_db/src/helpers/generated_lints.rs` from `tidy::check_todo`
Lukas Wirth [Fri, 4 Jun 2021 17:03:45 +0000 (19:03 +0200)]
Replace `-` with `_` in generated lint names
Lukas Wirth [Fri, 4 Jun 2021 16:55:08 +0000 (18:55 +0200)]
Generate default lint groups
Lukas Wirth [Fri, 4 Jun 2021 16:35:19 +0000 (18:35 +0200)]
Generate default lint completions
Lukas Wirth [Fri, 4 Jun 2021 15:03:18 +0000 (17:03 +0200)]
Implement hover for lints
bors[bot] [Fri, 4 Jun 2021 14:51:39 +0000 (14:51 +0000)]
Merge #9137
9137: fix: fix incorrect "unresolved import" error when using derive helpers r=jonas-schievink a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9133
cursed bug
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 4 Jun 2021 14:50:35 +0000 (16:50 +0200)]
Return `ReachedFixedPoint::No` when resolving derive helper
bors[bot] [Fri, 4 Jun 2021 13:55:49 +0000 (13:55 +0000)]
Merge #9136
9136: feat: Add function references hover action r=Veykril a=Veykril
![image](https://user-images.githubusercontent.com/
3757771 /
120811670 -
8422ed80 -c54c-11eb-87f5-
dd65c1f8ef7d .png)
This is off by default as this can slow down hover messages significantly for very big projects I believe.
Fixes #6590
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 4 Jun 2021 13:49:43 +0000 (15:49 +0200)]
Add function references hover action
bors[bot] [Fri, 4 Jun 2021 12:10:21 +0000 (12:10 +0000)]
Merge #9135
9135: Reorganize inlay_hints tests r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 4 Jun 2021 12:09:20 +0000 (14:09 +0200)]
Cleanup parameter_hint_heuristics inlay hints test
Lukas Wirth [Fri, 4 Jun 2021 11:47:39 +0000 (13:47 +0200)]
Reorganize inlay_hints tests
bors[bot] [Thu, 3 Jun 2021 16:17:25 +0000 (16:17 +0000)]
Merge #9128
9128: feat: expand procedural attribute macros r=jonas-schievink a=jonas-schievink
This adds experimental support for attribute macros. They can be enabled by setting `rust-analyzer.experimental.procAttrMacros` to `true`.
Known issues:
* Tokens aren't remapped, presumably because we edit the input syntax tree (this causes IDE features to not work inside items with attribute macros on them)
* Macro errors aren't reported correctly
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8971
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8964 / https://github.com/la10736/rstest/issues/120
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/2984
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5412
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6029
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6687
https://github.com/rust-analyzer/rust-analyzer/issues/6740 is still not fixed – we now expand `#[proc_macro_hack]`, but fail to expand the resulting `proc_macro_call!()` macro.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Jun 2021 16:11:33 +0000 (18:11 +0200)]
Set enable_proc_attr_macros in hir_ty TestDB
Jonas Schievink [Thu, 3 Jun 2021 16:06:17 +0000 (18:06 +0200)]
Update list of built-in attributes
Jonas Schievink [Thu, 3 Jun 2021 14:11:20 +0000 (16:11 +0200)]
Make it opt-in
Jonas Schievink [Mon, 31 May 2021 11:37:11 +0000 (13:37 +0200)]
Expand procedural attribute macros
bors[bot] [Thu, 3 Jun 2021 14:26:07 +0000 (14:26 +0000)]
Merge #9130
9130: Prefix/suffix parameter inlay hint hiding heuristic is more strict r=Veykril a=Veykril
Instead of just plainly checking prefix/suffix of the argument string to the parameter name we only check for prefixes and suffixes if they are split apart via an underscore meaning, with the argument `foo`, it will be hidden for the parameter name `foo_bar` but not for `foobar`.
bors r+
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8878
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 3 Jun 2021 14:22:24 +0000 (16:22 +0200)]
Prefix/suffix parameter inlay hint hiding heuristic is more strict
bors[bot] [Thu, 3 Jun 2021 13:45:17 +0000 (13:45 +0000)]
Merge #9129
9129: NFC: remove redundant clones (clippy::perf) r=Veykril a=matthiaskrgr
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Matthias Krüger [Thu, 3 Jun 2021 13:32:46 +0000 (15:32 +0200)]
NFC: remove redundant clones (clippy::perf)
bors[bot] [Thu, 3 Jun 2021 12:27:57 +0000 (12:27 +0000)]
Merge #9127
9127: internal: make variant fields inherit the enum's visibility in the ItemTree r=jonas-schievink a=jonas-schievink
No observable changes from what I can tell, but this is "more correct".
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Jun 2021 12:26:26 +0000 (14:26 +0200)]
ItemTree: make variant fields inherit the enum's visibility
bors[bot] [Thu, 3 Jun 2021 12:09:10 +0000 (12:09 +0000)]
Merge #9124
9124: Apply a few clippy suggestions r=lnicola a=clemenswasser
Co-authored-by: Clemens Wasser <clemens.wasser@gmail.com>
bors[bot] [Thu, 3 Jun 2021 11:52:15 +0000 (11:52 +0000)]
Merge #9104
9104: Implement `#[rustc_skip_array_during_method_dispatch]` r=flodiebold a=jonas-schievink
haxx run the world
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8552
Part of https://github.com/rust-analyzer/rust-analyzer/issues/9056
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Jun 2021 11:51:43 +0000 (13:51 +0200)]
Add comment
Clemens Wasser [Thu, 3 Jun 2021 11:01:16 +0000 (13:01 +0200)]
Use push_str
Clemens Wasser [Thu, 3 Jun 2021 10:46:56 +0000 (12:46 +0200)]
Apply more clippy suggestions and update generated
bors[bot] [Thu, 3 Jun 2021 09:55:37 +0000 (09:55 +0000)]
Merge #9105
9105: internal: calculate pattern adjustments r=flodiebold a=iDawer
This extends `InferenceResult` with `pub pat_adjustments: FxHashMap<PatId, Vec<Ty>>`.
Fixes #9095
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
Clemens Wasser [Thu, 3 Jun 2021 09:45:10 +0000 (11:45 +0200)]
Apply a few clippy suggestions
bors[bot] [Thu, 3 Jun 2021 08:24:56 +0000 (08:24 +0000)]
Merge #9123
9123: manual.adoc: add Gentoo Linux installation method r=lnicola a=mjkalyan
Added installation instructions for the binary ebuild of the "latest" `rust-analyzer` in Gentoo's GURU repository.
Co-authored-by: mjkalyan <34904034+mjkalyan@users.noreply.github.com>
mjkalyan [Thu, 3 Jun 2021 06:16:23 +0000 (00:16 -0600)]
manual.adoc: add Gentoo Linux installation method
Added installation instructions for the binary ebuild of the "latest" `rust-analyzer` in Gentoo's GURU repository.
bors[bot] [Wed, 2 Jun 2021 20:28:15 +0000 (20:28 +0000)]
Merge #9119
9119: fix: some minor "extract type alias" fixes r=jonas-schievink a=jonas-schievink
It now correctly works inside traits, and no longer messes up the indentation of the original node
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Wed, 2 Jun 2021 20:27:12 +0000 (22:27 +0200)]
Preserve indentation
Jonas Schievink [Wed, 2 Jun 2021 20:20:41 +0000 (22:20 +0200)]
Account for traits
bors[bot] [Wed, 2 Jun 2021 20:12:10 +0000 (20:12 +0000)]
Merge #9118
9118: Document that `addCallArgumentSnippets` requires `addCallParenthesis r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Wed, 2 Jun 2021 20:10:09 +0000 (22:10 +0200)]
Document that `addCallArgumentSnippets` requires `addCallParenthesis
bors[bot] [Wed, 2 Jun 2021 19:43:29 +0000 (19:43 +0000)]
Merge #9117
9117: Allow expand-macro to be invoked anywhere inside a macro call r=Veykril a=Veykril
I don't really see a reason to only limit this to the name-ref of a macro.
bors r+
Closes #4606
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Wed, 2 Jun 2021 19:39:53 +0000 (21:39 +0200)]
Allow expand-macro to be invoked anywhere inside a macro call
bors[bot] [Wed, 2 Jun 2021 18:01:42 +0000 (18:01 +0000)]
Merge #9114
9114: Fix bind patterns always being treated as ref taking patterns r=Veykril a=Veykril
Fixes #9107
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Wed, 2 Jun 2021 18:00:39 +0000 (20:00 +0200)]
Fix bind patterns always being treated as ref taking patterns
bors[bot] [Wed, 2 Jun 2021 17:25:11 +0000 (17:25 +0000)]
Merge #9108
9108: Don't show extract into variable assist for unit expressions r=jonas-schievink a=brandondong
**Reproduction:**
```rust
fn main() {
let mut i = 3;
$0if i >= 0 {
i += 1;
} else {
i -= 1;
}$0
}
```
1. Select the snippet of code between the $0's.
2. The extract into variable assist shows up, pushing down the more useful extract into function assist.
3. The resulting output of selecting the extract into variable assist is valid but with the extracted variable having the unit type:
```rust
fn main() {
let mut i = 3;
let var_name = if i >= 0 {
i += 1;
} else {
i -= 1;
};
var_name
}
```
**Fix:**
- Don't show the extract into variable assist for unit expressions. I could not think of any scenarios where such a variable extraction would be desired.
Co-authored-by: Brandon <brandondong604@hotmail.com>
bors[bot] [Wed, 2 Jun 2021 16:18:42 +0000 (16:18 +0000)]
Merge #9112
9112: Fix some bugs in `extract_struct_from_enum_variant` assist r=Veykril a=Veykril
bors r+
Fixes #9100
Fixes #9099
Kind of fixes #9109, it now copies all the generics might be incorrect if the variant doesn't use all of them)
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>