demo from https://youtrack.jetbrains.com/issue/IDEA-129972