boolean (@NotNull PsiFile file, int offset, @NotNull String selectedText, char c) { if ((c == '<' || c == '>') && selectedText.length() <= 3 && isOnlyComparisons(selectedText)) { PsiElement elementAtOffset = file.findElementAt(offset); if (elementAtOffset != null) { IElementType tokenType = elementAtOffset.getNode().getElementType(); ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(elementAtOffset.getLanguage()); if (parserDefinition != null && (parserDefinition.getCommentTokens().contains(tokenType) || parserDefinition.getStringLiteralElements().contains(tokenType))) { return false; } } return true; } return false; }