rust/crates/ra_hir_def/src
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
..
body Merge #3062 2020-02-11 21:46:36 +00:00
nameres Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
path include requested changes 2020-02-02 08:04:24 -05:00
adt.rs replace uses of VariantData::is_unit with VariantData::kind 2020-02-16 16:10:32 +01:00
attr.rs Use different types for path with and without generics 2019-12-14 19:15:40 +01:00
body.rs Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
builtin_type.rs Rename N! to name! 2019-12-13 22:33:38 +01:00
child_by_source.rs Share impl Scope between modules and blocks 2019-12-22 15:52:35 +01:00
data.rs Remove AsyncOwner 2019-12-25 00:25:18 +08:00
db.rs Apply review suggestions 2020-01-11 23:33:04 +01:00
diagnostics.rs Rename Source -> InFile 2019-11-28 12:50:26 +03:00
docs.rs Move enum&union to new loc 2019-12-12 15:11:57 +01:00
dyn_map.rs DynMap 2019-12-06 21:28:05 +01:00
expr.rs Merge #3062 2020-02-11 21:46:36 +00:00
find_path.rs Add the tests 2020-01-28 18:03:24 +02:00
generics.rs Formatting 2020-02-07 18:28:10 +01:00
item_scope.rs Apply review suggestions 2020-01-11 23:33:04 +01:00
keys.rs Make FromSource private 2020-01-16 16:08:46 +01:00
lang_item.rs Add helpers for unpacking lang items 2019-12-29 17:38:37 +01:00
lib.rs Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
marks.rs Add the tests 2020-01-28 18:03:24 +02:00
nameres.rs Publicize debug printing of CrateDefMap 2020-01-28 16:29:31 +01:00
path.rs Merge #2962 2020-02-04 09:44:31 +00:00
per_ns.rs Rename ResolvedVisibility -> Visibility 2019-12-26 16:23:40 +01:00
resolver.rs Make Self implement the trait inside trait default methods 2020-02-14 20:39:04 +01:00
src.rs Reduce copy-paste some more 2019-12-20 13:58:09 +01:00
test_db.rs Use query for importable locations 2020-01-11 23:33:04 +01:00
trace.rs Remove import source map 2019-12-21 17:26:28 +01:00
type_ref.rs Formatting 2020-02-07 18:28:10 +01:00
visibility.rs visible_from -> is_visible_from 2019-12-27 11:25:04 +01:00