use of com.intellij.extapi.psi.ASTWrapperPsiElement in project intellij-community by JetBrains.
the class TraverserBasedASTNode method getPsiImpl.
public PsiElement getPsiImpl() {
IElementType type = getElementType();
ParserDefinition pd = LanguageParserDefinitions.INSTANCE.forLanguage(type.getLanguage());
if (pd != null && pd.getWhitespaceTokens().contains(type) || pd == null && type == TokenType.WHITE_SPACE) {
return new PsiWhiteSpaceImpl(getChars());
} else if (pd != null && pd.getCommentTokens().contains(type)) {
return new ASTWrapperPsiComment(this);
} else if (pd == null || myNode instanceof LighterASTTokenNode) {
return new ASTWrapperPsiElement(this);
} else {
return pd.createElement(this);
}
}
use of com.intellij.extapi.psi.ASTWrapperPsiElement in project intellij-community by JetBrains.
the class GroovyDocPsiCreator method createElement.
public static PsiElement createElement(ASTNode node) {
IElementType type = node.getElementType();
if (type instanceof GroovyDocTagValueTokenType) {
GroovyDocTagValueTokenType value = (GroovyDocTagValueTokenType) type;
GroovyDocTagValueTokenType.TagValueTokenType valueType = GroovyDocTagValueTokenType.getValueType(node);
if (valueType == GroovyDocTagValueTokenType.TagValueTokenType.REFERENCE_ELEMENT)
return new GrDocReferenceElementImpl(node);
return new GrDocTagValueTokenImpl(node);
}
if (type == GroovyDocElementTypes.GDOC_TAG)
return new GrDocTagImpl(node);
if (type == GroovyDocElementTypes.GDOC_INLINED_TAG)
return new GrDocInlinedTagImpl(node);
if (type == GroovyDocElementTypes.GDOC_METHOD_REF)
return new GrDocMethodReferenceImpl(node);
if (type == GroovyDocElementTypes.GDOC_FIELD_REF)
return new GrDocFieldReferenceImpl(node);
if (type == GroovyDocElementTypes.GDOC_PARAM_REF)
return new GrDocParameterReferenceImpl(node);
if (type == GroovyDocElementTypes.GDOC_METHOD_PARAMS)
return new GrDocMethodParamsImpl(node);
if (type == GroovyDocElementTypes.GDOC_METHOD_PARAMETER)
return new GrDocMethodParameterImpl(node);
return new ASTWrapperPsiElement(node);
}
Aggregations