当前位置: 首页>>代码示例>>Java>>正文


Java DebugUtil.checkTreeStructure方法代码示例

本文整理汇总了Java中com.intellij.psi.impl.DebugUtil.checkTreeStructure方法的典型用法代码示例。如果您正苦于以下问题:Java DebugUtil.checkTreeStructure方法的具体用法?Java DebugUtil.checkTreeStructure怎么用?Java DebugUtil.checkTreeStructure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.impl.DebugUtil的用法示例。


在下文中一共展示了DebugUtil.checkTreeStructure方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: rawAddChildrenWithoutNotifications

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
public void rawAddChildrenWithoutNotifications(TreeElement first) {
  final TreeElement last = getLastChildNode();
  if (last == null){
    first.rawRemoveUpToWithoutNotifications(null, false);
    setFirstChildNode(first);
    while(true){
      final TreeElement treeNext = first.getTreeNext();
      first.setTreeParent(this);
      if(treeNext == null) break;
      first = treeNext;
    }
    setLastChildNode(first);
    first.setTreeParent(this);
  }
  else {
    last.rawInsertAfterMeWithoutNotifications(first);
  }

  DebugUtil.checkTreeStructure(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CompositeElement.java

示例2: rawRemove

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
public void rawRemove() {
  final TreeElement next = getTreeNext();
  final CompositeElement parent = getTreeParent();
  final TreeElement prev = getTreePrev();

  if(prev != null){
    prev.setTreeNext(next);
  }
  else if(parent != null) {
    parent.setFirstChildNode(next);
  }

  if(next != null){
    next.setTreePrev(prev);
  }
  else if(parent != null) {
    parent.setLastChildNode(prev);
  }

  DebugUtil.checkTreeStructure(parent);
  DebugUtil.checkTreeStructure(prev);
  DebugUtil.checkTreeStructure(next);

  invalidate();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:TreeElement.java

示例3: doActualPsiChange

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@Override
void doActualPsiChange(@NotNull PsiFile file, @NotNull ASTDiffBuilder astDiffBuilder) {
  ASTNode child = myOldNode;
  ASTNode parent = myOldParent;

  PsiElement psiParent = parent.getPsi();
  PsiElement psiChild = file.isPhysical() ? child.getPsi() : null;

  if (psiParent != null && psiChild != null) {
    PsiTreeChangeEventImpl event = new PsiTreeChangeEventImpl(file.getManager());
    event.setParent(psiParent);
    event.setChild(psiChild);
    event.setFile(file);
    ((PsiManagerEx)file.getManager()).beforeChildRemoval(event);
  }

  astDiffBuilder.nodeDeleted(parent, child);

  ((TreeElement)child).rawRemove();
  ((CompositeElement)parent).subtreeChanged();

  DebugUtil.checkTreeStructure(parent);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DiffLog.java

示例4: doActualPsiChange

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@Override
void doActualPsiChange(@NotNull PsiFile file, @NotNull ASTDiffBuilder astDiffBuilder) {
  ASTNode child = myOldNode;
  ASTNode parent = myOldParent;

  PsiElement psiParent = parent.getPsi();
  PsiElement psiChild = file.isPhysical() ? child.getPsi() : null;

  if (psiParent != null && psiChild != null) {
    PsiTreeChangeEventImpl event = new PsiTreeChangeEventImpl(file.getManager());
    event.setParent(psiParent);
    event.setChild(psiChild);
    event.setFile(file);
    ((PsiManagerEx)file.getManager()).beforeChildRemoval(event);
  }

  astDiffBuilder.nodeDeleted(parent, child);

  ((TreeElement)child).rawRemove();
  ((CompositeElement)parent).subtreeChanged();

  DebugUtil.checkTreeStructure(parent);

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:DiffLog.java

示例5: rawAddChildrenWithoutNotifications

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
public void rawAddChildrenWithoutNotifications(@Nonnull TreeElement first) {
  if (DebugUtil.DO_EXPENSIVE_CHECKS && !(this instanceof LazyParseableElement)) {
    PsiFileImpl file = getCachedFile(this);
    if (file != null && !file.useStrongRefs()) {
      throw new AssertionError("Attempt to modify PSI in a file with weakly-referenced AST. Possible cause: missing PomTransaction.");
    }
  }

  final TreeElement last = getLastChildNode();
  if (last == null){
    TreeElement chainLast = rawSetParents(first, this);
    setFirstChildNode(first);
    setLastChildNode(chainLast);
  }
  else {
    last.rawInsertAfterMeWithoutNotifications(first);
  }

  DebugUtil.checkTreeStructure(this);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:CompositeElement.java

示例6: parseContents

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@Override
public ASTNode parseContents(ASTNode chameleon) {
  final CharTable charTable = SharedImplUtil.findCharTableByTree(chameleon);
  final FileElement fileElement = TreeUtil.getFileElement((TreeElement)chameleon);
  final PsiFile psiFile = (PsiFile)fileElement.getPsi();
  PsiFile originalPsiFile = psiFile.getOriginalFile();

  final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)originalPsiFile.getViewProvider();

  final Language templateLanguage = getTemplateFileLanguage(viewProvider);
  final CharSequence sourceCode = chameleon.getChars();

  RangesCollector collector = new RangesCollector();
  final PsiFile templatePsiFile = createTemplateFile(psiFile, templateLanguage, sourceCode, viewProvider, collector);

  final FileElement templateFileElement = ((PsiFileImpl)templatePsiFile).calcTreeElement();

  DebugUtil.startPsiModification("template language parsing");
  try {
    prepareParsedTemplateFile(templateFileElement);
    insertOuters(templateFileElement, sourceCode, collector.myRanges, charTable);

    TreeElement childNode = templateFileElement.getFirstChildNode();

    DebugUtil.checkTreeStructure(templateFileElement);
    DebugUtil.checkTreeStructure(chameleon);
    if (fileElement != chameleon) {
      DebugUtil.checkTreeStructure(psiFile.getNode());
      DebugUtil.checkTreeStructure(originalPsiFile.getNode());
    }

    return childNode;
  }
  finally {
    DebugUtil.finishPsiModification();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:TemplateDataElementType.java

示例7: parseContents

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@Override
public ASTNode parseContents(ASTNode chameleon) {
  final CharTable table = SharedImplUtil.findCharTableByTree(chameleon);
  final FileElement treeElement = new DummyHolder(((TreeElement)chameleon).getManager(), null, table).getTreeElement();
  final FileElement fileElement = TreeUtil.getFileElement((TreeElement)chameleon);
  final PsiFile file = (PsiFile)fileElement.getPsi();
  PsiFile originalFile = file.getOriginalFile();

  final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)originalFile.getViewProvider();

  final Language language = getTemplateFileLanguage(viewProvider);
  final CharSequence chars = chameleon.getChars();

  final PsiFile templateFile = createTemplateFile(file, language, chars, viewProvider);

  final FileElement parsed = ((PsiFileImpl)templateFile).calcTreeElement();

  DebugUtil.startPsiModification("template language parsing");
  try {
    prepareParsedTemplateFile(parsed);
    Lexer langLexer = LanguageParserDefinitions.INSTANCE.forLanguage(language).createLexer(file.getProject());
    final Lexer lexer = new MergingLexerAdapter(
      new TemplateBlackAndWhiteLexer(createBaseLexer(viewProvider), langLexer, myTemplateElementType, myOuterElementType),
      TokenSet.create(myTemplateElementType, myOuterElementType));
    lexer.start(chars);
    insertOuters(parsed, lexer, table);

    if (parsed != null) {
      final TreeElement element = parsed.getFirstChildNode();
      if (element != null) {
        parsed.rawRemoveAllChildren();
        treeElement.rawAddChildren(element);
      }
    }
  }
  finally {
    DebugUtil.finishPsiModification();
  }

  treeElement.subtreeChanged();
  TreeElement childNode = treeElement.getFirstChildNode();

  DebugUtil.checkTreeStructure(parsed);
  DebugUtil.checkTreeStructure(treeElement);
  DebugUtil.checkTreeStructure(chameleon);
  if (fileElement != chameleon) {
    DebugUtil.checkTreeStructure(file.getNode());
    DebugUtil.checkTreeStructure(originalFile.getNode());
  }

  return childNode;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:53,代码来源:TemplateDataElementType.java

示例8: parseContents

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@Override
public ASTNode parseContents(ASTNode chameleon) {
  final CharTable table = SharedImplUtil.findCharTableByTree(chameleon);
  final FileElement treeElement = new DummyHolder(((TreeElement)chameleon).getManager(), null, table).getTreeElement();
  final PsiFile file = (PsiFile)TreeUtil.getFileElement((TreeElement)chameleon).getPsi();
  PsiFile originalFile = file.getOriginalFile();

  final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)originalFile.getViewProvider();

  final Language language = getTemplateFileLanguage(viewProvider);
  final CharSequence chars = chameleon.getChars();

  final PsiFile templateFile = createTemplateFile(file, language, chars, viewProvider);

  final FileElement parsed = ((PsiFileImpl)templateFile).calcTreeElement();
  prepareParsedTemplateFile(parsed);
  Lexer langLexer = LanguageParserDefinitions.INSTANCE.forLanguage(language).createLexer(file.getProject());
  final Lexer lexer = new MergingLexerAdapter(
    new TemplateBlackAndWhiteLexer(createBaseLexer(viewProvider), langLexer, myTemplateElementType, myOuterElementType),
    TokenSet.create(myTemplateElementType, myOuterElementType));
  lexer.start(chars);
  insertOuters(parsed, lexer, table);

  if (parsed != null) {
    final TreeElement element = parsed.getFirstChildNode();
    if (element != null) {
      parsed.rawRemoveAllChildren();
      treeElement.rawAddChildren(element);
    }
  }

  treeElement.subtreeChanged();
  TreeElement childNode = treeElement.getFirstChildNode();

  DebugUtil.checkTreeStructure(parsed);
  DebugUtil.checkTreeStructure(treeElement);
  DebugUtil.checkTreeStructure(chameleon);
  DebugUtil.checkTreeStructure(file.getNode());
  DebugUtil.checkTreeStructure(originalFile.getNode());

  return childNode;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:43,代码来源:TemplateDataElementType.java


注:本文中的com.intellij.psi.impl.DebugUtil.checkTreeStructure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。