rust/crates
bors[bot] 4a2f60cb7b
Merge #6964
6964: Add full pattern completions for Struct and Variant patterns r=matklad a=Veykril


Just gonna call it full pattern completion as pattern completion is already implemented in a sense by showing idents in pattern position. What this does is basically complete struct and variant patterns where applicable(function params, let statements and refutable pattern locations).

This does not replace just completing the corresponding idents of the structs and variants, instead two completions are shown for these, a completion for the ident itself and a completion for the pattern(if the pattern make sense to be used that is). I figured in some cases one would rather type out the pattern manually if it has a lot of fields but you only care about one since this completion would cause one more work in the end since you would have to delete all the extra matched fields again.

These completions are tagged as `CompletionKind::Snippet`, not sure if that is the right one here.
<details>
  <summary>some gifs</summary>

![dx2lxgzhj3](https://user-images.githubusercontent.com/3757771/102719967-6987ef80-42f1-11eb-8ae0-8aff53777860.gif)
![EP2E7sJLkB](https://user-images.githubusercontent.com/3757771/102785777-c7264580-439e-11eb-8a64-f142e19fb65b.gif)
![JMNHHWknr9](https://user-images.githubusercontent.com/3757771/102785796-d1e0da80-439e-11eb-934b-218ada31b51c.gif)
</details>

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-22 18:03:51 +00:00
..
arena
assists Improve extract_module_to_file assist 2020-12-22 19:13:53 +03:00
base_db Introduce anchored_path 2020-12-09 19:07:05 +03:00
cfg Remove some redundant allocations 2020-12-12 12:27:09 -05:00
completion Reduce some more code duplication 2020-12-22 19:00:38 +01:00
flycheck Pin cargo_metadata 2020-11-25 10:11:53 -05:00
hir Merge #6964 2020-12-22 18:03:51 +00:00
hir_def Merge #6921 2020-12-20 11:47:01 +00:00
hir_expand More accurate #[derive] parsing 2020-12-19 01:10:56 +01:00
hir_ty Higher-ranked trait bounds for where clauses 2020-12-17 22:01:42 +01:00
ide Merge #6746 2020-12-22 10:04:24 +00:00
ide_db Add initial_contents field for CreateFile 2020-12-21 15:55:40 +09:00
mbe Use pattern_single instead of pattern in mbe pat 2020-12-20 17:13:40 +08:00
parser Merge #6965 2020-12-21 08:54:31 +00:00
paths
proc_macro_api Remove dummy ProcMacroClient in favor of Option 2020-12-07 17:16:50 +01:00
proc_macro_srv Replace goblin crate with object 2020-12-13 14:08:59 +02:00
proc_macro_test
profile Deny unreachable-pub 2020-11-02 14:07:08 +01:00
project_model Fun times with rustfmt 2020-12-17 10:24:58 -08:00
rust-analyzer Merge #6993 2020-12-22 15:07:36 +00:00
ssr Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
stdx add open Cargo.toml action 2020-11-12 17:48:07 -08:00
syntax Merge #6965 2020-12-21 08:54:31 +00:00
test_utils Make config.rs a single source of truth for configuration. 2020-12-08 19:25:41 +03:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain
tt Simplify error formatting 2020-11-26 21:07:15 +02:00
vfs Merge #6785 2020-12-09 16:32:03 +00:00
vfs-notify