rust-analyzer/crates/ra_hir/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
..
code_model.rs show names for record fields in enum completion 2020-02-16 16:10:23 +01:00
db.rs Re-sync queries for memory usage measurnment 2020-01-29 16:10:46 +01:00
diagnostics.rs Move Ty 2019-11-27 21:16:00 +03:00
from_id.rs Qualify some paths in 'add missing impl members' 2020-01-11 23:33:04 +01:00
has_source.rs Remove imports from hir 2019-12-21 15:18:14 +01:00
lib.rs show names for record fields in enum completion 2020-02-16 16:10:23 +01:00
source_analyzer.rs Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
source_binder.rs Fix comment 2020-01-16 17:57:50 +01:00