As shown below, these three references resolve to the same PsiMethod(friend), but only the other two references that have the same number of characters as friend are correctly highlighted, friendId is not highlighted, only the quick document
It’s hard to say without the complete source. There’s no limit on number of characters. The main requirement for an identifier to appear in find usages results is to have a reference at those offsets, resolving to the correct element. If you do have all of these, you can submit an issue to youtrack.jetbrains.com and attach the project to reproduce