CodeStyleManagerDecorator extends CodeStyleManagerImpl #313
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.
Before this PR
Using this plugin in IntelliJ versions newer than 202.5103.13 leads to the following exception and failure to format newly created Java files.
Steps to reproduce in an existing Java project:
JetBrains/intellij-community@2d57401 added a
CodeStyleManager#scheduleReformatWhenSettingsComputed(PsiFile)
instance method inidea/202.5103.13
where the default implementation throws an UnsuportedOperationException.See https://youtrack.jetbrains.com/issue/IDEA-244645 for more details (though that stacktrace shows similar bug with Eclipse Code Formatter plugin as used by default with gradle-baseline.
IntelliJ build info
After this PR
==COMMIT_MSG==
Explicitly extend the IntelliJ CodeStyleManagerImpl so that any methods added in newer releases are inherited automatically with a reasonable default implementation.
==COMMIT_MSG==
Possible downsides?
There may be cases where
CodeStyleManagerDecorator
should intercept new methods added toCodeStyleManagerImpl
in the future and handle them in a different fashion.