PsiElementKind (@NotNull PsiElement element, @Nullable SyntaxHighlighter syntaxHighlighter) { TextAttributesKey[] keys; if (element.getParent() instanceof PsiLiteralValue || ChunkExtractor.isHighlightedAsString(keys = syntaxHighlighter == null ? TextAttributesKey.EMPTY_ARRAY : syntaxHighlighter.getTokenHighlights(((LeafElement)element).getElementType()))) { return PsiElementKind.STRING; } if (element instanceof PsiComment || ChunkExtractor.isHighlightedAsComment(keys)) { return PsiElementKind.COMMENT; } if (isIdentifier(element)) { return PsiElementKind.IDENTIFIER; } return PsiElementKind.OTHER; }