mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
show names for record fields in enum completion
This commit is contained in:
parent
b2b94cbf71
commit
04aff742b1
4 changed files with 109 additions and 7 deletions
|
@ -3,6 +3,7 @@ use std::sync::Arc;
|
|||
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
adt::StructKind,
|
||||
adt::VariantData,
|
||||
builtin_type::BuiltinType,
|
||||
docs::Documentation,
|
||||
|
@ -424,6 +425,10 @@ impl EnumVariant {
|
|||
.collect()
|
||||
}
|
||||
|
||||
pub fn kind(self, db: &impl HirDatabase) -> StructKind {
|
||||
self.variant_data(db).kind()
|
||||
}
|
||||
|
||||
pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> {
|
||||
db.enum_data(self.parent.id).variants[self.id].variant_data.clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue