boolean (@NotNull Editor editor, @NotNull ShFile file) { if (editor.getCaretModel().getPrimaryCaret().hasSelection()) return true; TextRange textRange = ShTextOccurrencesUtil.findTextRangeOfIdentifierAtCaret(editor); if (textRange != null) { PsiElement element = file.findElementAt(textRange.getStartOffset()); if (element != null && ShTokenTypes.keywords.contains(PsiUtilCore.getElementType(element))) { return false; } } return true; }