项目: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;
}
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);
}
项目: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);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。