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

text-minimessage: Add a builder for PlaceholderResolvers #665

Merged
merged 2 commits into from
Jan 16, 2022

Conversation

zml2008
Copy link
Member

@zml2008 zml2008 commented Jan 13, 2022

Closes GH-656

Should we keep the static factory methods after this builder is added? do some of them make sense to get rid of?

I've noticed some of the static factory methods use live views of provided collections in the returned resolvers. I think this is generally the wrong choice, since it could result in live state being modified in unexpected ways, and it is trivial to implement a live PlaceholderResolver if that behavior truly desired. Does anyone have a defense of that live collection behavior?

@gepron1x
Copy link

Cool! Would you mind adding convenience placeholder methods that takes primitives and such? E.g builder.placeholder(key, int), builder.placeholder(key, component), placeholder(key, string)

@zml2008
Copy link
Member Author

zml2008 commented Jan 16, 2022

@gepron1x that can definitely be considered after the next stage of refactoring -- I had them in initial work on the builder, but chose to remove them to match the factory methods for PlaceholderResolvers.

@zml2008 zml2008 force-pushed the feature/placeholder-resolver-builder branch from 977a0bc to e828094 Compare January 16, 2022 19:35
@zml2008 zml2008 enabled auto-merge January 16, 2022 19:36
@zml2008 zml2008 merged commit 65314a2 into master Jan 16, 2022
@zml2008 zml2008 deleted the feature/placeholder-resolver-builder branch January 16, 2022 19:43
@zml2008 zml2008 self-assigned this Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Placeholder resolver builder
3 participants