com.intellij.psi.impl.source.tree.LazyParseableElement的实例源码

项目:consulo-xml    文件XmlASTLazyFactory.java   
@NotNull
@Override
public LazyParseableElement createLazy(ILazyParseableElementType type,CharSequence text) {
  if (type == XML_FILE) {
    return new XmlFileElement(type,text);
  }
  else if (type == DTD_FILE) {
    return new XmlFileElement(type,text);
  }
  else if (type == XHTML_FILE) {
    return new XmlFileElement(type,text);
  }
  else if (type == HTML_FILE) {
    return new HtmlFileElement(text);
  }
  else if (type instanceof TemplateDataElementType) {
    return new XmlFileElement(type,text);
  }
  return null;
}
项目:intellij-ce-playground    文件MiscpsiTest.java   
public void testDoNotExpandnestedChameleons() throws Exception {
  PsiJavaFile file = (PsiJavaFile)myFixture.addFiletoProject("a.java","class A {{{}}}");
  file.getNode();

  PsiCodeBlock initializer = file.getClasses()[0].getinitializers()[0].getBody();
  assertFalse(assertInstanceOf(initializer.getNode(),LazyParseableElement.class).isParsed());

  PsiCodeBlock nestedBlock = ((PsiBlockStatement)initializer.getStatements()[0]).getCodeBlock();
  assertTrue(assertInstanceOf(initializer.getNode(),LazyParseableElement.class).isParsed());
  assertFalse(assertInstanceOf(nestedBlock.getNode(),LazyParseableElement.class).isParsed());
}
项目:intellij-ce-playground    文件ASTFactory.java   
@NotNull
public static LazyParseableElement lazy(@NotNull final ILazyParseableElementType type,CharSequence text) {
  final ASTNode node = type.createNode(text);
  if (node != null) return (LazyParseableElement)node;

  if (type == TokenType.CODE_FRAGMENT) {
    return new CodeFragmentElement(null);
  }
  else if (type == TokenType.DUMMY_HOLDER) {
    return new DummyHolderElement(text);
  }

  final LazyParseableElement customLazy = factory(type).createLazy(type,text);
  return customLazy != null ? customLazy : DefaultFactoryHolder.DEFAULT.createLazy(type,text);
}
项目:tools-idea    文件MiscpsiTest.java   
public void testDoNotExpandnestedChameleons() throws Exception {
  PsiJavaFile file = (PsiJavaFile)myFixture.addFiletoProject("a.java",LazyParseableElement.class).isParsed());
}
项目:intellij-ce-playground    文件ASTFactory.java   
@Nullable
public LazyParseableElement createLazy(final ILazyParseableElementType type,final CharSequence text) {
  return null;
}
项目:intellij-haxe    文件HaxeAstFactory.java   
@Nullable
@Override
public LazyParseableElement createLazy(ILazyParseableElementType type,CharSequence text) {
  return super.createLazy(type,text);
}
项目:consulo    文件ASTLazyFactory.java   
@Nonnull
LazyParseableElement createLazy(final ILazyParseableElementType type,final CharSequence text);
项目:consulo    文件ASTFactory.java   
@Nonnull
public static LazyParseableElement lazy(@Nonnull final ILazyParseableElementType type,final CharSequence text) {
  return ASTLazyFactory.EP.getValue(type).createLazy(type,text);
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...