提交 09c065b3 编写于 作者: S Svetlana Isakova

usage 'call.getCallElement' instead of 'call.getCalleeExpression' while...

usage 'call.getCallElement' instead of 'call.getCalleeExpression' while 'invisible member' error reporting
上级 36224dd3
......@@ -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);
}
};
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册