void (@NotNull List<? extends PsiElement> targets) { TextRange textRange = ShTextOccurrencesUtil.findTextRangeOfIdentifierAtCaret(myEditor); if (textRange != null) { CharSequence documentText = StringUtil.newBombedCharSequence(myEditor.getDocument().getImmutableCharSequence(), 3000); boolean hasSelection = myEditor.getCaretModel().getPrimaryCaret().hasSelection(); ShTextOccurrencesUtil.consumeAllOccurrences( documentText, textRange.subSequence(documentText), !hasSelection, range -> myReadUsages.add(InjectedLanguageManager.getInstance(myFile.getProject()).injectedToHost(myFile, range))); } }