KT-7693 Unused constructor parameter is not detected if class is constructed with named argument
#KT-7693 fixed
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.ItemPresentationProviders;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.lexer.JetTokens;
|
||||
@@ -174,4 +175,17 @@ public class JetParameter extends JetNamedDeclarationStub<KotlinParameterStub> i
|
||||
public List<JetTypeParameter> getTypeParameters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SearchScope getUseScope() {
|
||||
PsiElement parent = getParent();
|
||||
if (parent != null) {
|
||||
PsiElement grandparent = parent.getParent();
|
||||
if (grandparent instanceof JetNamedFunction) {
|
||||
return grandparent.getUseScope();
|
||||
}
|
||||
}
|
||||
return super.getUseScope();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user