https://github.com/JetBrains/intellij-community/pull/46
(cherry picked from commit 75588fa)