From 450d49ffb816bd1f5f713825d77b85dd6154dff2 Mon Sep 17 00:00:00 2001 From: Techassi Date: Fri, 6 Sep 2024 12:28:48 +0200 Subject: [PATCH 1/2] feat(stackable-versioned): Add 'use super::*' to generated version modules Co-authored-by: Sebastian Bernauer --- crates/stackable-versioned-macros/src/codegen/venum/mod.rs | 2 ++ crates/stackable-versioned-macros/src/codegen/vstruct/mod.rs | 2 ++ crates/stackable-versioned/CHANGELOG.md | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/stackable-versioned-macros/src/codegen/venum/mod.rs b/crates/stackable-versioned-macros/src/codegen/venum/mod.rs index 47744e330..a9aefb0ce 100644 --- a/crates/stackable-versioned-macros/src/codegen/venum/mod.rs +++ b/crates/stackable-versioned-macros/src/codegen/venum/mod.rs @@ -150,6 +150,8 @@ impl VersionedEnum { #[automatically_derived] #deprecated_attr #visibility mod #version_ident { + use super::*; + #(#original_attributes)* #version_specific_docs pub enum #enum_name { diff --git a/crates/stackable-versioned-macros/src/codegen/vstruct/mod.rs b/crates/stackable-versioned-macros/src/codegen/vstruct/mod.rs index 7f5aa4e70..f4c257e56 100644 --- a/crates/stackable-versioned-macros/src/codegen/vstruct/mod.rs +++ b/crates/stackable-versioned-macros/src/codegen/vstruct/mod.rs @@ -150,6 +150,8 @@ impl VersionedStruct { #[automatically_derived] #deprecated_attr #visibility mod #version_ident { + use super::*; + #(#original_attributes)* #version_specific_docs pub struct #struct_name { diff --git a/crates/stackable-versioned/CHANGELOG.md b/crates/stackable-versioned/CHANGELOG.md index 85d7b2360..0a488c984 100644 --- a/crates/stackable-versioned/CHANGELOG.md +++ b/crates/stackable-versioned/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. - Pass through container and item attributes (including doc-comments). Add attribute for version specific docs ([#847]). - Forward container visibility to generated modules ([#850]). +- Add `use super::*` to version modules to be able to use imported types + ([#xxx]). ### Changed @@ -19,12 +21,13 @@ All notable changes to this project will be documented in this file. ### Fixed - Report variant rename validation error at the correct span and trim underscores - from variants not using PascalCase (#[842]). + from variants not using PascalCase ([#842]). [#842]: https://github.com/stackabletech/operator-rs/pull/842 [#844]: https://github.com/stackabletech/operator-rs/pull/844 [#847]: https://github.com/stackabletech/operator-rs/pull/847 [#850]: https://github.com/stackabletech/operator-rs/pull/850 +[#xxx]: https://github.com/stackabletech/operator-rs/pull/xxx ## [0.1.1] - 2024-07-10 From 8544c2bfa4635a7cb5a576c2cc5bae3dadb1c987 Mon Sep 17 00:00:00 2001 From: Techassi Date: Fri, 6 Sep 2024 12:30:29 +0200 Subject: [PATCH 2/2] chore: Update PR link in changelog --- crates/stackable-versioned/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/stackable-versioned/CHANGELOG.md b/crates/stackable-versioned/CHANGELOG.md index 0a488c984..2c8f05c38 100644 --- a/crates/stackable-versioned/CHANGELOG.md +++ b/crates/stackable-versioned/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. attribute for version specific docs ([#847]). - Forward container visibility to generated modules ([#850]). - Add `use super::*` to version modules to be able to use imported types - ([#xxx]). + ([#859]). ### Changed @@ -27,7 +27,7 @@ All notable changes to this project will be documented in this file. [#844]: https://github.com/stackabletech/operator-rs/pull/844 [#847]: https://github.com/stackabletech/operator-rs/pull/847 [#850]: https://github.com/stackabletech/operator-rs/pull/850 -[#xxx]: https://github.com/stackabletech/operator-rs/pull/xxx +[#859]: https://github.com/stackabletech/operator-rs/pull/859 ## [0.1.1] - 2024-07-10