mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-15 20:26:04 +07:00
fixed PY-9819 Wrong highlight for property in metaclass
This commit is contained in:
@@ -31,6 +31,7 @@ public class PyNames {
|
||||
public static final String CLASS = "__class__";
|
||||
public static final String DUNDER_METACLASS = "__metaclass__";
|
||||
public static final String METACLASS = "metaclass";
|
||||
public static final String TYPE = "type";
|
||||
|
||||
public static final String SUPER = "super";
|
||||
|
||||
|
||||
@@ -264,6 +264,8 @@ public class PyPropertyDefinitionInspection extends PyInspection {
|
||||
|
||||
private void checkForSelf(PyParameterList param_list) {
|
||||
PyParameter[] parameters = param_list.getParameters();
|
||||
final PyClass cls = PsiTreeUtil.getParentOfType(param_list, PyClass.class);
|
||||
if (cls != null && cls.isSubclass("type")) return;
|
||||
if (parameters.length > 0 && ! PyNames.CANONICAL_SELF.equals(parameters[0].getName())) {
|
||||
registerProblem(
|
||||
parameters[0], PyBundle.message("INSP.accessor.first.param.is.$0", PyNames.CANONICAL_SELF), ProblemHighlightType.WEAK_WARNING, null,
|
||||
|
||||
Reference in New Issue
Block a user