Fix OC-8127: Appcode hangs on reformatting (endless right shift) + review CR-OC @Anton.Makeev, @Rustam.Vishnyakov
(cherry picked from commit 2b4b70f)