HighlightSeverity (TypeEvalContext context) { final PyExpression qualifier = myElement.getQualifier(); if (qualifier != null && context.getType(qualifier) == null) { /* in case the element qualifier can not be resolved, the qualifier need to be highlighted instead of the element */ return null; } return HighlightSeverity.ERROR; }