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 getters and ability to copy settings between CodeWriters #1067

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

mtdowling
Copy link
Member

It's sometimes useful to create other CodeWriters to do some work that
uses the same settings as another CodeWriter. The copySettingsFrom
method of CodeWriter takes another CodeWriter and copies its global and
state settings into itself.

This change also updates formatters registered with a CodeWriter to be
per/state. This means that if a formatter is added in a specific state,
then what that state is popped, the formatter is also removed and the
CodeWriter returns to its original state.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mtdowling mtdowling requested a review from a team as a code owner January 28, 2022 23:43
It's sometimes useful to create other CodeWriters to do some work that
uses the same settings as another CodeWriter. The `copySettingsFrom`
method of CodeWriter takes another CodeWriter and copies its global and
state settings into itself.

This change also updates formatters registered with a CodeWriter to be
per/state. This means that if a formatter is added in a specific state,
then what that state is popped, the formatter is also removed and the
CodeWriter returns to its original state.

Closes #1066
@mtdowling mtdowling force-pushed the codewriter-copy-state branch from f27d6a1 to 3ca3861 Compare January 29, 2022 03:36
@mtdowling mtdowling merged commit 5aaceb7 into main Feb 2, 2022
@mtdowling mtdowling deleted the codewriter-copy-state branch April 8, 2022 05:31
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.

3 participants