getUseScope() fixed for destructuring declarations #KT-14181 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-10-04 15:36:42 +03:00
parent e7d290f726
commit de865c6d46
2 changed files with 2 additions and 2 deletions
@@ -142,7 +142,7 @@ public class KtDestructuringDeclarationEntry extends KtNamedDeclarationNotStubbe
@NotNull
@Override
public SearchScope getUseScope() {
KtElement enclosingBlock = KtPsiUtil.getEnclosingElementForLocalDeclaration(this, false);
KtElement enclosingBlock = KtPsiUtil.getEnclosingElementForLocalDeclaration(this, true);
if (enclosingBlock != null) return new LocalSearchScope(enclosingBlock);
return super.getUseScope();
@@ -796,7 +796,7 @@ public class KtPsiUtil {
return (KtElement) parent;
}
}
if (current instanceof KtBlockExpression || current instanceof KtParameter) {
if (current instanceof KtBlockExpression || (current instanceof KtParameter && !skipParameters)) {
return (KtElement) current;
}
if (current instanceof KtValueArgument) {