Made rename refactoring inplace for loop, catch and function literal parameters.

#KT-1296 fixed
This commit is contained in:
Evgeny Gerashchenko
2013-12-23 21:18:19 +04:00
parent 600bb49894
commit 90ad65bff8
18 changed files with 189 additions and 3 deletions
@@ -1006,9 +1006,15 @@ public class JetPsiUtil {
@Nullable
public static JetElement getEnclosingElementForLocalDeclaration(@Nullable JetNamedDeclaration declaration) {
if (declaration instanceof JetTypeParameter || declaration instanceof JetParameter) {
if (declaration instanceof JetTypeParameter) {
declaration = PsiTreeUtil.getParentOfType(declaration, JetNamedDeclaration.class);
}
else if (declaration instanceof JetParameter) {
PsiElement parent = declaration.getParent();
if (parent != null && parent.getParent() instanceof JetNamedFunction) {
declaration = (JetNamedFunction) parent.getParent();
}
}
//noinspection unchecked
JetElement container = PsiTreeUtil.getParentOfType(