usage 'call.getCallElement' instead of 'call.getCalleeExpression' while 'invisible member' error reporting
This commit is contained in:
@@ -51,7 +51,7 @@ public interface Errors {
|
||||
//Elements with "INVISIBLE_REFERENCE" error are marked as unresolved, unlike elements with "INVISIBLE_MEMBER" error
|
||||
DiagnosticFactory2<JetSimpleNameExpression, DeclarationDescriptor, DeclarationDescriptor> INVISIBLE_REFERENCE =
|
||||
DiagnosticFactory2.create(ERROR);
|
||||
DiagnosticFactory2<PsiElement, DeclarationDescriptor, DeclarationDescriptor> INVISIBLE_MEMBER = DiagnosticFactory2.create(ERROR);
|
||||
DiagnosticFactory2<PsiElement, DeclarationDescriptor, DeclarationDescriptor> INVISIBLE_MEMBER = DiagnosticFactory2.create(ERROR, PositioningStrategies.CALL_ELEMENT);
|
||||
|
||||
RedeclarationDiagnosticFactory REDECLARATION = new RedeclarationDiagnosticFactory(ERROR);
|
||||
RedeclarationDiagnosticFactory NAME_SHADOWING = new RedeclarationDiagnosticFactory(WARNING);
|
||||
|
||||
@@ -151,4 +151,18 @@ public class PositioningStrategies {
|
||||
return markNode(element.getDefaultValue().getNode());
|
||||
}
|
||||
};
|
||||
|
||||
public static PositioningStrategy<PsiElement> CALL_ELEMENT = new PositioningStrategy<PsiElement>() {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<TextRange> mark(@NotNull PsiElement callElement) {
|
||||
if (callElement instanceof JetCallElement) {
|
||||
JetExpression calleeExpression = ((JetCallElement) callElement).getCalleeExpression();
|
||||
if (calleeExpression != null) {
|
||||
return markElement(calleeExpression);
|
||||
}
|
||||
}
|
||||
return markElement(callElement);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user