For now, we extract every item that lives in a crate, but not modules. Indeed, if we disregard attributes, a module is really just a group of items, so having modules as such is not useful, we can recover the module structure looking at names.
However, modules can also carry attributes, so we need a way of retrieving them. ~Either:~
~- we extract mod items, consisting of a list of names plus a list of attributes;~
~- we add a parent_attributes field on each item, but that will cause duplication of attributes.~
~I think having mod items is the way to go.~
Because it was easier, the -ugly- second option was implemented.
Instead, I think we should extract a simple mapping from module def_ids to attributes, in addition to a list of items.
This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.
For now, we extract every item that lives in a crate, but not modules. Indeed, if we disregard attributes, a module is really just a group of items, so having modules as such is not useful, we can recover the module structure looking at names.
However, modules can also carry attributes, so we need a way of retrieving them. ~Either:~ ~- we extract
mod
items, consisting of a list of names plus a list of attributes;~ ~- we add aparent_attributes
field on each item, but that will cause duplication of attributes.~~I think having
mod
items is the way to go.~Because it was easier, the -ugly- second option was implemented.
Instead, I think we should extract a simple mapping from module
def_id
s to attributes, in addition to a list of items.