Skip to content
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

Merged
merged 3 commits into from
Jul 23, 2021
Merged

Add support for multi-module projects #32

merged 3 commits into from
Jul 23, 2021

Conversation

shadaj
Copy link
Member

@shadaj shadaj commented Jul 22, 2021

TODO:

@shadaj shadaj requested review from sffc and Manishearth July 22, 2021 18:49
@shadaj shadaj marked this pull request as ready for review July 22, 2021 23:04
declared_types: custom_types_by_name,
sub_modules,
}
}
}

fn extract_imports(base_path: &Path, use_tree: &UseTree, out: &mut Vec<(Path, String)>) {
Copy link
Contributor

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.

Copy link
Member Author

@shadaj shadaj Jul 23, 2021

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)>,
Copy link
Contributor

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?

Copy link
Member Author

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.

@shadaj shadaj merged commit 0513b67 into main Jul 23, 2021
@shadaj shadaj deleted the multi-module branch July 23, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants