Java 类com.intellij.psi.impl.source.tree.AstBufferUtil 实例源码

项目:intellij-ce-playground    文件:SliceLeafAnalyzer.java   
@Override
public int computeHashCode(final PsiElement element) {
  if (element == null) return 0;
  String text = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
    @Override
    public String compute() {
      PsiElement elementToCompare = element;
      if (element instanceof PsiJavaReference) {
        PsiElement resolved = ((PsiJavaReference)element).resolve();
        if (resolved != null) {
          elementToCompare = resolved;
        }
      }
      return elementToCompare instanceof PsiNamedElement ? ((PsiNamedElement)elementToCompare).getName()
                                                         : AstBufferUtil.getTextSkippingWhitespaceComments(elementToCompare.getNode());
    }
  });
  return Comparing.hashcode(text);
}
项目:tools-idea    文件:SliceLeafAnalyzer.java   
@Override
public int computeHashCode(final PsiElement element) {
  if (element == null) return 0;
  String text = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
    @Override
    public String compute() {
      PsiElement elementToCompare = element;
      if (element instanceof PsiJavaReference) {
        PsiElement resolved = ((PsiJavaReference)element).resolve();
        if (resolved != null) {
          elementToCompare = resolved;
        }
      }
      return elementToCompare instanceof PsiNamedElement ? ((PsiNamedElement)elementToCompare).getName()
                                                         : AstBufferUtil.getTextSkippingWhitespaceComments(elementToCompare.getNode());
    }
  });
  return Comparing.hashcode(text);
}
项目:consulo-java    文件:SliceLeafAnalyzer.java   
@Override
public int computeHashCode(final PsiElement element) {
  if (element == null) return 0;
  String text = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
    @Override
    public String compute() {
      PsiElement elementToCompare = element;
      if (element instanceof PsiJavaReference) {
        PsiElement resolved = ((PsiJavaReference)element).resolve();
        if (resolved != null) {
          elementToCompare = resolved;
        }
      }
      return elementToCompare instanceof PsiNamedElement ? ((PsiNamedElement)elementToCompare).getName()
                                                         : AstBufferUtil.getTextSkippingWhitespaceComments(elementToCompare.getNode());
    }
  });
  return Comparing.hashcode(text);
}
项目:intellij-ce-playground    文件:PsiImplUtil.java   
public static String getTextSkipWhiteSpaceAndComments(ASTNode node) {
  return AstBufferUtil.getTextSkippingWhitespaceComments(node);
}
项目:tools-idea    文件:PsiImplUtil.java   
public static String getTextSkipWhiteSpaceAndComments(ASTNode node) {
  return AstBufferUtil.getTextSkippingWhitespaceComments(node);
}