void (@NotNull final PyClassStub stub, @NotNull final IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(PyClassNameIndex.KEY, name); sink.occurrence(PyClassNameIndexInsensitive.KEY, StringUtil.toLowerCase(name)); if (stub.getParentStub() instanceof PyFileStub && PyUtil.getInitialUnderscores(name) == 0) { sink.occurrence(PyExportedModuleAttributeIndex.KEY, name); } } for (String attribute : PyClassAttributesIndex.getAllDeclaredAttributeNames(stub.getPsi())) { sink.occurrence(PyClassAttributesIndex.KEY, attribute); } stub.getSuperClasses().values() .stream() .filter(Objects::nonNull) .map(QualifiedName::getLastComponent) .filter(Objects::nonNull) .forEach(className -> sink.occurrence(PySuperClassIndex.KEY, className)); }