Made rename refactoring inplace for loop, catch and function literal parameters.
#KT-1296 fixed
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user