Move: Show error message on applying to enum entries

#KT-14182 Fixed
This commit is contained in:
Alexey Sedunov
2016-10-04 19:37:25 +03:00
parent fad4944eee
commit a6601b27e9
2 changed files with 7 additions and 0 deletions
@@ -83,6 +83,12 @@ class MoveKotlinDeclarationsHandler : MoveHandlerDelegate() {
return true
}
if (elementsToSearch.any { it is KtEnumEntry }) {
val message = RefactoringBundle.getCannotRefactorMessage("Move declaration is not supported for enum entries")
CommonRefactoringUtil.showErrorHint(project, editor, message, MOVE_DECLARATIONS, null)
return true
}
when (container) {
is PsiDirectory, is PsiPackage, is KtFile -> {
val targetPackageName = MoveClassesOrPackagesImpl.getInitialTargetPackageName(targetContainer, elements)