Fix AutoCorrection crashing with Missing extension point#4545
Merged
cortinico merged 1 commit intodetekt:mainfrom Feb 4, 2022
Merged
Fix AutoCorrection crashing with Missing extension point#4545cortinico merged 1 commit intodetekt:mainfrom
cortinico merged 1 commit intodetekt:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4545 +/- ##
============================================
+ Coverage 84.13% 84.14% +0.01%
- Complexity 3313 3315 +2
============================================
Files 477 477
Lines 10922 10920 -2
Branches 2030 2031 +1
============================================
Hits 9189 9189
+ Misses 700 699 -1
+ Partials 1033 1032 -1
Continue to review full report at Codecov.
|
BraisGabin
approved these changes
Jan 31, 2022
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.
Fixes #4003
Fixes #4500
Fixes #4489
This issue was apparently caused by my PR #3848
What is happening is that KtLint is enabling AST mutation on the Root Extension, while we're not. Therefore, as the
autoCorrecttries to mutate the AST it crashes with the mentioned message.Moreover there was a
!missing which was causing the code to do nothing. I've also removed thesyncronizedas KtLint is not using it either.I've tested locally with a SNAPSHOT version and it works for me. I'm unsure how we can test this with an automated test.
Sadly we will have to live with the deprecated
getRootArea(). KtLint is having that as well so I guess they'll find a way if JetBrains decides to remove this API (and we'll have to follow their approach).