Fix add modifier for replacement case, add expect/actual order tests

This commit is contained in:
Mikhail Glukhikh
2017-09-15 18:10:33 +03:00
committed by Stanislav Erokhin
parent 2c521727c3
commit e12de11ce9
14 changed files with 32 additions and 5 deletions
@@ -83,10 +83,11 @@ internal fun addModifier(modifierList: KtModifierList, modifier: KtModifierKeywo
}
return
}
if (modifierToReplace != null) {
if (modifierToReplace != null && modifierList.firstChild == modifierList.lastChild) {
modifierToReplace.replace(newModifier)
}
else {
modifierToReplace?.delete()
val newModifierOrder = MODIFIERS_ORDER.indexOf(modifier)
fun placeAfter(child: PsiElement): Boolean {