Search in sources :

Example 6 with TextChunk

use of com.intellij.usages.TextChunk in project intellij-community by JetBrains.

the class UsagesInAnalyzingDependenciesTest method toString.

@NotNull
private static String toString(@NotNull Usage usage) {
    JBIterable<TextChunk> it = JBIterable.of(usage.getPresentation().getText());
    TextChunk first = it.first();
    assert first != null;
    JBIterable<TextChunk> rest = it.skip(1);
    return first.toString() + " " + StringUtil.join(rest, Object::toString, "");
}
Also used : TextChunk(com.intellij.usages.TextChunk) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

TextChunk (com.intellij.usages.TextChunk)6 PsiFile (com.intellij.psi.PsiFile)3 UsagePresentation (com.intellij.usages.UsagePresentation)3 SimpleTextAttributes (com.intellij.ui.SimpleTextAttributes)2 Usage (com.intellij.usages.Usage)2 NotNull (org.jetbrains.annotations.NotNull)2 Language (com.intellij.lang.Language)1 JavaLanguage (com.intellij.lang.java.JavaLanguage)1 Document (com.intellij.openapi.editor.Document)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 SimpleColoredComponent (com.intellij.ui.SimpleColoredComponent)1 UsageNode (com.intellij.usages.impl.UsageNode)1 EmptyIcon (com.intellij.util.ui.EmptyIcon)1 ArrayList (java.util.ArrayList)1