void (KotlinStubWithFqName<?> stub, IndexSink sink) { String name = stub.getName(); if (name == null) return; KotlinModifierListStub modifierList = getModifierListStub(stub); if (modifierList != null && modifierList.hasModifier(KtTokens.PRIVATE_KEYWORD)) return; if (modifierList != null && modifierList.hasModifier(KtTokens.OVERRIDE_KEYWORD)) return; var parent = stub.getParentStub(); boolean prime = false; if (parent instanceof KotlinFileStub) { prime = true; } else if (parent instanceof KotlinObjectStub) { var grand = parent.getParentStub(); boolean primeGrand = grand instanceof KotlinClassStub && ((KotlinClassStub) grand).isTopLevel(); prime = ((KotlinObjectStub) parent).isTopLevel() || primeGrand && ((KotlinObjectStub) parent).isCompanion(); } if (prime) { sink.occurrence(KotlinPrimeSymbolNameIndex.Helper.getIndexKey(), name); } }