rust-analyzer/crates
bors[bot] fcf15cc05a
Merge #3169
3169: Show record field names in Enum completion r=flodiebold a=adamrk

Adresses https://github.com/rust-analyzer/rust-analyzer/issues/2947.
Previously the details shown when autocompleting an Enum variant would look like the variant was a tuple even if it was a record:
![2020-02-16-15:59:32_crop](https://user-images.githubusercontent.com/16367467/74607233-64f21980-50d7-11ea-99db-e973e29c71d7.png)

This change will show the names of the fields for a record and use curly braces instead of parentheses:
![2020-02-16-15:33:00_crop](https://user-images.githubusercontent.com/16367467/74607251-8ce17d00-50d7-11ea-9d4d-38d198a4aec0.png)

This required exposing the type `adt::StructKind` from `ra_hir` and adding a function 
```
kind(self, db: &impl HirDatabase) -> StructKind
```
in the `impl` of `EnumVariant`. 

There was also a previously existing function `is_unit(self, db: &impl HirDatabase) -> bool` for `EnumVariant` which I removed because it seemed redundant after adding `kind`.

Co-authored-by: adamrk <ark.email@gmail.com>
2020-02-17 10:54:32 +00:00
..
ra_arena Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_assists Merge #3108 2020-02-17 09:34:08 +00:00
ra_batch Support setting cargo features 2019-12-13 18:16:34 +08:00
ra_cargo_watch Update snapshot tests due to removed SuggestedFix 2020-02-03 12:24:57 +01:00
ra_cfg Disable doctests 2019-11-17 18:35:05 +03:00
ra_cli 1-based columns 2020-02-16 18:30:48 +01:00
ra_db Apply the reviews suggestions 2020-02-05 12:47:28 +02:00
ra_fmt Refactor if-let -> match assist to use ast::make 2020-02-05 14:08:16 +01:00
ra_hir Merge #3169 2020-02-17 10:54:32 +00:00
ra_hir_def Merge #3169 2020-02-17 10:54:32 +00:00
ra_hir_expand Add couple of utility methods 2020-02-12 18:19:55 +01:00
ra_hir_ty Merge #3169 2020-02-17 10:54:32 +00:00
ra_ide Merge #3169 2020-02-17 10:54:32 +00:00
ra_ide_db Remove extra dep 2020-02-15 23:23:44 +01:00
ra_lsp_server Merge #3099 2020-02-17 10:02:54 +00:00
ra_mbe ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR review 2020-02-04 00:00:55 +02:00
ra_parser Add test for unnamed argument in function pointer 2020-02-12 22:55:37 +01:00
ra_prof Enable profiling for bench 2020-02-16 18:04:08 +01:00
ra_project_model Make AtomicX type resolve again 2020-02-14 19:33:39 +01:00
ra_syntax Init implementation of structural search replace 2020-02-14 21:45:42 +00:00
ra_text_edit move to to_usize() 2020-02-10 01:57:43 +02:00
ra_tt Refactoring 2019-12-18 13:10:37 +08:00
ra_vfs_glob Disable doctests 2019-11-17 18:35:05 +03:00
test_utils Simplify fixture parsing 2020-01-30 13:17:56 +01:00