Java 类com.intellij.psi.impl.PsiTreeDebugBuilder 实例源码

项目:consulo-csharp    文件:CSharpStubElementImpl.java   
@NotNull
@SuppressWarnings("unchecked")
public <T> T getRequiredStubOrPsiChildByIndex(@NotNull TokenSet set, int index)
{
    T element = getStubOrPsiChildByIndex(set, index);
    if(element == null)
    {
        throw new IllegalArgumentException("Element by set: " + set + " and index:" + index + " is not found. Tree:\n " + new
                PsiTreeDebugBuilder().psiToString(this, false, false));
    }
    return element;
}
项目:intellij-ce-playground    文件:XPathElementImpl.java   
protected String unexpectedPsiAssertion() {
  final PsiTreeDebugBuilder builder = new PsiTreeDebugBuilder();
  return "Unexpected PSI structure: " + builder.psiToString(this) + "--\ninside: " + builder.psiToString(getContainingFile());
}
项目:tools-idea    文件:XPathElementImpl.java   
protected String unexpectedPsiAssertion() {
  final PsiTreeDebugBuilder builder = new PsiTreeDebugBuilder();
  return "Unexpected PSI structure: " + builder.psiToString(this) + "--\ninside: " + builder.psiToString(getContainingFile());
}
项目:consulo-csharp    文件:CreateUnresolvedLikeMethodFix.java   
@Nullable
@RequiredReadAction
public String buildArgumentTypeRefs()
{
    CSharpReferenceExpression element = myPointer.getElement();
    if(element == null)
    {
        return null;
    }

    StringBuilder builder = new StringBuilder();

    CSharpCallArgumentListOwner parent = PsiTreeUtil.getParentOfType(element, CSharpCallArgumentListOwner.class);

    if(parent == null)
    {
        LOGGER.error("Can't find parent by 'CSharpCallArgumentListOwner'. Element: " + new PsiTreeDebugBuilder().psiToString(element));
        return null;
    }

    CSharpCallArgument[] callArguments = parent.getCallArguments();

    for(int i = 0; i < callArguments.length; i++)
    {
        if(i != 0)
        {
            builder.append(", ");
        }

        CSharpCallArgument callArgument = callArguments[i];

        DotNetExpression argumentExpression = callArgument.getArgumentExpression();
        if(argumentExpression != null)
        {
            DotNetTypeRef typeRef = argumentExpression.toTypeRef(false);
            builder.append(CSharpTypeRefPresentationUtil.buildShortText(typeRef, element));
        }
        else
        {
            builder.append("object");
        }
    }
    return builder.toString();
}