mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Add docs to struct fields
This commit is contained in:
parent
55906341a6
commit
7a0bc2dd64
6 changed files with 26 additions and 8 deletions
|
@ -216,6 +216,15 @@ impl StructField {
|
|||
}
|
||||
}
|
||||
|
||||
impl Docs for StructField {
|
||||
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
|
||||
match self.source(db).1 {
|
||||
FieldSource::Named(named) => docs_from_ast(&*named),
|
||||
FieldSource::Pos(..) => return None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct Struct {
|
||||
pub(crate) id: StructId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue