Conversation
This is done by adding a visibility modifier on the macro invocation:
```rust
// `MyContainer` will be a `pub` struct
impl MyContainer { }
```
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for configuring the visibility of generated dependency container structs through the #[dependency_container] macro. By default, containers remain private, but users can now specify visibility modifiers like pub, pub(crate), pub(super), or pub(in path) as macro arguments.
- Added visibility modifier parameter to the
#[dependency_container]macro - Threaded visibility through input parsing, processing, and output generation layers
- Added comprehensive test coverage for all Rust visibility modifiers
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| despatma/src/lib.rs | Added documentation section explaining container visibility feature and usage examples |
| despatma-dependency-container/tests/expand/visibility.rs | Added test cases covering all visibility modifiers (private, pub, pub(crate), pub(self), pub(super), pub(in path)) |
| despatma-dependency-container/tests/expand/visibility.expanded.rs | Expected macro expansion output for visibility test cases |
| despatma-dependency-container/src/lib.rs | Updated macro entry point to parse visibility parameter and apply it to the container |
| despatma-dependency-container/src/input.rs | Added vis field to Container struct with setter method and default Inherited visibility |
| despatma-dependency-container/src/processing/mod.rs | Added vis field to processing Container and updated conversion logic |
| despatma-dependency-container/src/output.rs | Added vis field to output Container and applied it to generated struct definition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is done by adding a visibility modifier on the macro invocation:
Closes #40