-
Notifications
You must be signed in to change notification settings - Fork 47
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
[scarb-doc] Add initial crate structures #1309
base: main
Are you sure you want to change the base?
Conversation
crate_roots: dependencies, | ||
crates_config, | ||
}, | ||
fn print_module(module: &types::Module) { |
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 know that it's for testing mainly, but this should be implemented via Display
nonetheless
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 also feel like sub-structs could also have Display
s and so on...
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.
True, but there's a good chance it'll be removed soon anyway so I didn't bother D; (as you've mentioned it's only for testing)
const LIB_TARGET_KIND: &str = "lib"; | ||
const CORELIB_CRATE_NAME: &str = "core"; | ||
|
||
pub fn get_project_config( |
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.
These were just moved, right?
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.
Mainly yes, some slight refactor changes
pub definition: String, | ||
|
||
pub text: 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.
What's the difference between those two?
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.
It differs for item types but for example, a free function's definition
is its signature while text
is the whole function
} | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Constant { |
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 feel like all of those defs + impls are repetitive and could be done with a macro with like 3 input vars (pointer type, module type and the ModuleItemId)
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.
ikr, but they are planned to change and have some separate attributes, so I kept them like this for now
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.
[nitpick]: Those types are really nice, but i would try to give them each a docstring, for an example code snippet that they represent.
Next PR will add nested attributes to the structures: