void (@NotNull final PsiElement element) { if (holder.getResultCount() > 1000) return; final ASTNode node = element.getNode(); if (node == null) { return; } // Extract parser definition from element final Language language = element.getLanguage(); final IElementType elementType = node.getElementType(); final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(language); // Handle selected options if (parserDefinition != null) { if (parserDefinition.getStringLiteralElements().contains(elementType)) { if (!processLiterals) { return; } } else if (parserDefinition.getCommentTokens().contains(elementType)) { if (!processComments) { return; } } else if (!processCode) { return; } } PsiFile containingFile = element.getContainingFile(); if (containingFile != null && Boolean.TRUE.equals(containingFile.getUserData(InjectedLanguageManager.FRANKENSTEIN_INJECTION))) { return; } tokenize(element, language, new MyTokenConsumer(manager, holder, LanguageNamesValidation.INSTANCE.forLanguage(language))); }