-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multi-module projects #32
Conversation
… functions not public
declared_types: custom_types_by_name, | ||
sub_modules, | ||
} | ||
} | ||
} | ||
|
||
fn extract_imports(base_path: &Path, use_tree: &UseTree, out: &mut Vec<(Path, String)>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would only extract tagged imports, other imports should just be ignored IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is there any advantage from the Diplomat side for doing this? We handle unsupported imports by erroring out when one would be needed to resolve a path, so was thinking of only requiring annotations for DSTs to reduce noise.
|
||
use super::{CustomType, Method, ModSymbol, OpaqueStruct, Path, Struct, TypeName}; | ||
|
||
#[derive(Clone, Serialize, Deserialize, Debug)] | ||
pub struct Module { | ||
pub name: String, | ||
pub imports: Vec<(Path, String)>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only extract tagged imports, should these just add to the list of declared types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to support imports of other modules, so we can't assume that the import always is to a type.
TODO:
Support wildcard imports(Support wildcard imports when processing modules #31)